Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Androidports master #17

Closed

Conversation

androidports
Copy link

This is feedback from Office 700 app(iOS).

Change-Id: Ia703ccb6f5d823bf4ae0bf8c47af3a7b242c6d60
* external/liborcus/ExternalPackage_liborcus.mk Fix for suffix of library name for Android.
* external/liborcus/ExternalProject_liborcus.mk Override CXXFLAGS if CXXFLAGS is defined.
* external/liborcus/UnpackedTarball_liborcus.mk Add patch file for Android.
* external/liborcus/androidports.patch Remove system library path from LDFLAGS.
* external/clucene/Library_clucene.mk Override LIBS if LIBS is defined.
* external/clucene/UnpackedTarball_clucene.mk Add path file clucene-config-android.h.
* external/clucene/configs/_clucene-config-LINUX.h Use S_IRUSR S_IWUSR if S_IREAD S_IWRITE not defined.
* external/clucene/configs/clucene-config-android.h Undef _CL_HAVE_SYS_TIMEB_H for Android.
Change-Id: I6f8e0ce27841bccca3c3700369ca96263a71e3c9
* external/libetonyek/ExternalPackage_libetonyek.mk Fix for suffix of library name.
* external/libetonyek/UnpackedTarball_libetonyek.mk Add patch file.
* external/libetonyek/android.patch Remove system library path from LDFLAGS.
* external/librevenge/ExternalPackage_librevenge.mk Fix for suffix of library name.
* external/librevenge/ExternalProject_librevenge.mk Override CXXFLAGS if CXXFLAGS is defined.
_NL_PAPER_WIDTH and _NL_PAPER_HEIGHT is not defined in Android.
Change-Id: I91ff5c0e86c874a518d14f58e421124201e67185
Change-Id: I968823a26e09c0ddc190425b1dd404eab62a7415
Change-Id: If46bbd293063dd2c86b47f0bd668e25b438db406
* Add CXXFLAGS_CXX11 to CXXFLAGS to build as c++11 and override CXXFLAGS if CXXFLAGS is defined.

Change-Id: I88a65584d85e76f22faf63123289d334322d51d8
Change-Id: I637485348d999c74e3301a37f2a35a4f471a0401
* external/libmwaw/ExternalPackage_libmwaw.mk Fix for suffix of library name.
* external/libmwaw/ExternalProject_libmwaw.mk Consider predefined LDFLAGS and override CXXFLAGS if CXXFLAGS is defined.
* external/libmwaw/UnpackedTarball_libmwaw.mk Add patch file for Android.
* external/libmwaw/android.patch Remove system library path from LDFLAGS.
* external/libodfgen/ExternalPackage_libodfgen.mk Fix for suffix of library name.
* external/libodfgen/ExternalProject_libodfgen.mk Consider predefined LDFLAGS and override CXXFLAGS if CXXFLAGS is defined.
* external/libodfgen/UnpackedTarball_libodfgen.mk Add patch file for Android.
* external/libodfgen/android.patch Remove system library path from LDFLAGS.
* external/libstaroffice/ExternalPackage_libstaroffice.mk Fix for suffix of library name.
* external/libstaroffice/ExternalProject_libstaroffice.mk Consider predefined LDFLAGS and override CXXFLAGS if CXXFLAGS is defined.
* external/libstaroffice/UnpackedTarball_libstaroffice.mk Add patch file for Android.
* external/libstaroffice/android.patch Remove system library path from LDFLAGS.

Change-Id: I2ba86c64a81aa6a50a27d0bb9f7f46cba1645688
*Add CXXFLAGS_CXX11 to CXXFLAGS to build as c++11 and override CXXFLAGS if CXXFLAGS is defined.

Change-Id: Ide4d7e9feaea756daf25802b846e6de25740b083
* external/libwpd/ExternalPackage_libwpd.mk Fix for suffix of library name.
* external/libwpd/ExternalProject_libwpd.mk Consider predefined LDFLAGS.
* external/libwpd/UnpackedTarball_libwpd.mk Add patch file for Android.
* external/libwpd/android.patch Remove system library path from LDFLAGS.
tdf-gerrit pushed a commit that referenced this pull request Dec 12, 2024
although the actual order doesn't change there is a Delete/Insert of
the object in case the order should change.

::Insert will check if sorted and resort if not anyway, so presumably
if we just skip the middle-men and resort here if we need to then that
is equivalent, but without the invalidation for the already sorted case.

 #0  SwSortedObjs::Remove (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:243
 #1  0x00007fffce0af130 in SwSortedObjs::Update (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:282
 #2  0x00007fffcdf32c40 in SwAnchoredObject::UpdateObjInSortedList (this=0x51123c0) at core/sw/source/core/layout/anchoredobject.cxx:661
 #3  0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #4  0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #5  0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #6  0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #7  0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #8  0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #9  0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e68da0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #10 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #11 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e68da0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e68e68 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #12 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x5e47b90, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #13 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dce770, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #14 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e69dd0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #15 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #16 0x00007fffcdf31eaa in SwAnchoredObject::InvalidateObjPosForConsiderWrapInfluence (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:400
 #17 0x00007fffcdf32be5 in SwAnchoredObject::UpdateObjInSortedList (this=0x510e530) at core/sw/source/core/layout/anchoredobject.cxx:654
 #18 0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #19 0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #20 0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #21 0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #22 0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #23 0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #24 0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e364a0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #25 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #26 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e364a0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e36568 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #27 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x4a86e10, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #28 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dc65f0, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #29 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e3a0d0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #30 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e3a0d0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #31 0x00007fffcdf815b3 in (anonymous namespace)::IsNextContentFullPage (rThis=...) at core/sw/source/core/layout/flowfrm.cxx:217
 #32 0x00007fffcdf81002 in SwFlowFrame::IsKeep (this=0x4e5a630, rKeep=..., rBreak=..., bCheckIfLastRowShouldKeep=false) at core/sw/source/core/layout/flowfrm.cxx:259

Change-Id: If2191e8b99d1b0347bab54a704013ce0a9a19410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176992
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit f2cf4d9)
tdf-gerrit pushed a commit that referenced this pull request Dec 12, 2024
although the actual order doesn't change there is a Delete/Insert of
the object in case the order should change.

::Insert will check if sorted and resort if not anyway, so presumably
if we just skip the middle-men and resort here if we need to then that
is equivalent, but without the invalidation for the already sorted case.

 #0  SwSortedObjs::Remove (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:243
 #1  0x00007fffce0af130 in SwSortedObjs::Update (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:282
 #2  0x00007fffcdf32c40 in SwAnchoredObject::UpdateObjInSortedList (this=0x51123c0) at core/sw/source/core/layout/anchoredobject.cxx:661
 #3  0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #4  0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #5  0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #6  0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #7  0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #8  0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #9  0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e68da0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #10 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #11 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e68da0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e68e68 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #12 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x5e47b90, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #13 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dce770, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #14 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e69dd0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #15 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #16 0x00007fffcdf31eaa in SwAnchoredObject::InvalidateObjPosForConsiderWrapInfluence (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:400
 #17 0x00007fffcdf32be5 in SwAnchoredObject::UpdateObjInSortedList (this=0x510e530) at core/sw/source/core/layout/anchoredobject.cxx:654
 #18 0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #19 0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #20 0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #21 0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #22 0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #23 0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #24 0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e364a0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #25 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #26 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e364a0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e36568 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #27 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x4a86e10, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #28 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dc65f0, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #29 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e3a0d0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #30 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e3a0d0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #31 0x00007fffcdf815b3 in (anonymous namespace)::IsNextContentFullPage (rThis=...) at core/sw/source/core/layout/flowfrm.cxx:217
 #32 0x00007fffcdf81002 in SwFlowFrame::IsKeep (this=0x4e5a630, rKeep=..., rBreak=..., bCheckIfLastRowShouldKeep=false) at core/sw/source/core/layout/flowfrm.cxx:259

Change-Id: If2191e8b99d1b0347bab54a704013ce0a9a19410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176992
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit f2cf4d9)
tdf-gerrit pushed a commit that referenced this pull request Dec 13, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 16, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit 71a9de6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178544
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Miklos Vajna <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 16, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit 71a9de6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178543
Reviewed-by: Xisco Fauli <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 17, 2024
on loading tdf97831-15.xlsx

 #0  0x00007fffebea8664 in __pthread_kill_implementation () at /lib64/libc.so.6
 #1  0x00007fffebe4fc4e in raise () at /lib64/libc.so.6
 #2  0x00007fffebe37902 in abort () at /lib64/libc.so.6
 #3  0x00007fffebaa84e9 in __gnu_debug::_Error_formatter::_M_error() const [clone .cold] () at /lib64/libstdc++.so.6
 #4  0x00007fffa8d75183 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::forward_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:392
 #5  0x00007fffa8d73da2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::bidirectional_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:679
 #6  0x00007fffa8d71fd2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::random_access_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:849
 #7  0x00007fffa90d204e in ScDocument::GetCondResult (this=0x18fbcb0, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:816
 #8  0x00007fffa90d1ea1 in ScDocument::GetCondResult (this=0x18fbcb0, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809
 #9  0x00007fffa8f2740d in ScColumn::GetNeededSize
     (this=0x7fffd000b4d0, nRow=1, pDev=0x1fa6690, nPPTX=0.064757526036325508, nPPTY=0.067000000000000004, rZoomX=..., rZoomY=..., bWidth=false, rOptions=..., ppPatternChange=0x7fffffff9ba8, bInPrintTwips=false) at co-24.04/sc/source/core/data/column2.cxx:139
 #10 0x00007fffa8f2b887 in ScColumn::GetOptimalHeight (this=0x7fffd000b4d0, rCxt=..., nStartRow=0, nEndRow=24, nMinHeight=256, nMinStart=0)
     at co-24.04/sc/source/core/data/column2.cxx:1084
 #11 0x00007fffa94a28b7 in (anonymous namespace)::GetOptimalHeightsInColumn (rCxt=..., rCol=..., nStartRow=0, nEndRow=24, pProgress=0x0, nProgressStart=0)
     at co-24.04/sc/source/core/data/table1.cxx:120
 #12 0x00007fffa94a47f2 in ScTable::SetOptimalHeight (this=0x1f584a0, rCxt=..., nSt

where things go wrong earlier with:

 #2  0x00007fffacd716c3 in std::__new_allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/new_allocator.h:172
 #3  0x00007fffacd65215 in std::allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/allocator.h:208
 #4  std::allocator_traits<std::allocator<unsigned int> >::deallocate (__a=..., __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/alloc_traits.h:513
 #5  std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/stl_vector.h:389
 #6  0x00007fffacd60b88 in std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::~_Vector_base (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:368
 #7  0x00007fffacd60bef in std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:738
 #8  0x00007fffacd5ecd6 in std::__debug::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>) at /usr/include/c++/14/debug/vector:245
 #9  0x00007fffacd5feb6 in o3tl::sorted_vector<unsigned int, std::less<unsigned int>, o3tl::find_unique, true>::~sorted_vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>)
     at co-24.04/include/o3tl/sorted_vector.hxx:39
 #10 0x00007fffacd7a71c in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #11 0x00007fffacd7a748 in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #12 0x00007fffef638513 in implCleanupItemEntry (rPool=..., pSource=0x7fff9c1d2000) at co-24.04/svl/source/items/itemset.cxx:473
 #13 0x00007fffef638e00 in SfxItemSet::ClearAllItemsImpl (this=0x7fffffff8d38) at co-24.04/svl/source/items/itemset.cxx:643
 #14 0x00007fffef638a02 in SfxItemSet::~SfxItemSet (this=0x7fffffff8d38, __in_chrg=<optimized out>) at co-24.04/svl/source/items/itemset.cxx:562
 #15 0x00007fffacd5f7d0 in SfxSetItem::~SfxSetItem (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/include/svl/setitem.hxx:27
 #16 0x00007fffacd5f88e in ScPatternAttr::~ScPatternAttr (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/sc/inc/patattr.hxx:54
 #17 0x00007fffaceab497 in ScColumn::ApplyAttr (this=0x7fff9c027960, nRow=1, rAttr=...) at co-24.04/sc/source/core/data/column.cxx:573
 #18 0x00007fffacf38508 in ScColumn::SetNumberFormat (this=0x7fff9c027960, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/column2.cxx:3302
 #19 0x00007fffad4c3b55 in ScTable::SetNumberFormat (this=0x1d93840, nCol=7, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/table2.cxx:2315
 #20 0x00007fffad114bfa in ScDocument::SetNumberFormat (this=0x1c74100, rPos=..., nNumberFormat=99) at co-24.04/sc/source/core/data/document.cxx:3727
 #21 0x00007fffad356c65 in ScFormulaCell::InterpretTail (this=0x1cf9800, rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
     at co-24.04/sc/source/core/data/formulacell.cxx:2157
 #22 0x00007fffad354e67 in ScFormulaCell::Interpret (this=0x1cf9800, nStartOffset=-1, nEndOffset=-1) at co-24.04/sc/source/core/data/formulacell.cxx:1619
 #23 0x00007fffacf8e59f in ScFormulaCell::MaybeInterpret (this=0x1cf9800) at co-24.04/sc/inc/formulacell.hxx:470
 #24 0x00007fffad358dd4 in ScFormulaCell::IsValue (this=0x1cf9800) at co-24.04/sc/source/core/data/formulacell.cxx:2762
 #25 0x00007fffad025e1b in lcl_GetCellContent (rCell=..., bIsStr1=false, rArg=@0x7fffffff9208: 0, rArgStr="", pDoc=0x1c74100)
     at co-24.04/sc/source/core/data/conditio.cxx:764
 #26 0x00007fffad0286c5 in ScConditionEntry::IsCellValid (this=0x7fff9c1c73f0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1263
 #27 0x00007fffad02b18c in ScConditionalFormat::GetCellStyle (this=0x7fff9c02c1d0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1863
 #28 0x00007fffad0d20f8 in ScDocument::GetCondResult (this=0x1c74100, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:827
 #29 0x00007fffad0d1f91 in ScDocument::GetCondResult (this=0x1c74100, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809

very probably this is a problem since ItemSet rework of:

commit 2b4cb63
CommitDate: Tue Nov 21 16:08:57 2023 +0100

    Cleanup some ScPatternAttr specific stuff

or similar of that sequence, and likely fixed in upstream later by:

Author:     Armin Le Grand (allotropia) <[email protected]>
CommitDate: Thu Dec 28 19:38:15 2023 +0100

    Decouple ScPatternAttr from SfxItemPool

but that's a very sizable rework, so here apply a conservative simpler
workaround to avoid the crash.

Change-Id: I309953015d39bce4796a2cf99666603b00c34d24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178579
Reviewed-by: Andras Timar <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 18, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit 71a9de6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178544
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Miklos Vajna <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 18, 2024
on loading tdf97831-15.xlsx

 #0  0x00007fffebea8664 in __pthread_kill_implementation () at /lib64/libc.so.6
 #1  0x00007fffebe4fc4e in raise () at /lib64/libc.so.6
 #2  0x00007fffebe37902 in abort () at /lib64/libc.so.6
 #3  0x00007fffebaa84e9 in __gnu_debug::_Error_formatter::_M_error() const [clone .cold] () at /lib64/libstdc++.so.6
 #4  0x00007fffa8d75183 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::forward_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:392
 #5  0x00007fffa8d73da2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::bidirectional_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:679
 #6  0x00007fffa8d71fd2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::random_access_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:849
 #7  0x00007fffa90d204e in ScDocument::GetCondResult (this=0x18fbcb0, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:816
 #8  0x00007fffa90d1ea1 in ScDocument::GetCondResult (this=0x18fbcb0, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809
 #9  0x00007fffa8f2740d in ScColumn::GetNeededSize
     (this=0x7fffd000b4d0, nRow=1, pDev=0x1fa6690, nPPTX=0.064757526036325508, nPPTY=0.067000000000000004, rZoomX=..., rZoomY=..., bWidth=false, rOptions=..., ppPatternChange=0x7fffffff9ba8, bInPrintTwips=false) at co-24.04/sc/source/core/data/column2.cxx:139
 #10 0x00007fffa8f2b887 in ScColumn::GetOptimalHeight (this=0x7fffd000b4d0, rCxt=..., nStartRow=0, nEndRow=24, nMinHeight=256, nMinStart=0)
     at co-24.04/sc/source/core/data/column2.cxx:1084
 #11 0x00007fffa94a28b7 in (anonymous namespace)::GetOptimalHeightsInColumn (rCxt=..., rCol=..., nStartRow=0, nEndRow=24, pProgress=0x0, nProgressStart=0)
     at co-24.04/sc/source/core/data/table1.cxx:120
 #12 0x00007fffa94a47f2 in ScTable::SetOptimalHeight (this=0x1f584a0, rCxt=..., nSt

where things go wrong earlier with:

 #2  0x00007fffacd716c3 in std::__new_allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/new_allocator.h:172
 #3  0x00007fffacd65215 in std::allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/allocator.h:208
 #4  std::allocator_traits<std::allocator<unsigned int> >::deallocate (__a=..., __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/alloc_traits.h:513
 #5  std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/stl_vector.h:389
 #6  0x00007fffacd60b88 in std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::~_Vector_base (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:368
 #7  0x00007fffacd60bef in std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:738
 #8  0x00007fffacd5ecd6 in std::__debug::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>) at /usr/include/c++/14/debug/vector:245
 #9  0x00007fffacd5feb6 in o3tl::sorted_vector<unsigned int, std::less<unsigned int>, o3tl::find_unique, true>::~sorted_vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>)
     at co-24.04/include/o3tl/sorted_vector.hxx:39
 #10 0x00007fffacd7a71c in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #11 0x00007fffacd7a748 in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #12 0x00007fffef638513 in implCleanupItemEntry (rPool=..., pSource=0x7fff9c1d2000) at co-24.04/svl/source/items/itemset.cxx:473
 #13 0x00007fffef638e00 in SfxItemSet::ClearAllItemsImpl (this=0x7fffffff8d38) at co-24.04/svl/source/items/itemset.cxx:643
 #14 0x00007fffef638a02 in SfxItemSet::~SfxItemSet (this=0x7fffffff8d38, __in_chrg=<optimized out>) at co-24.04/svl/source/items/itemset.cxx:562
 #15 0x00007fffacd5f7d0 in SfxSetItem::~SfxSetItem (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/include/svl/setitem.hxx:27
 #16 0x00007fffacd5f88e in ScPatternAttr::~ScPatternAttr (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/sc/inc/patattr.hxx:54
 #17 0x00007fffaceab497 in ScColumn::ApplyAttr (this=0x7fff9c027960, nRow=1, rAttr=...) at co-24.04/sc/source/core/data/column.cxx:573
 #18 0x00007fffacf38508 in ScColumn::SetNumberFormat (this=0x7fff9c027960, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/column2.cxx:3302
 #19 0x00007fffad4c3b55 in ScTable::SetNumberFormat (this=0x1d93840, nCol=7, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/table2.cxx:2315
 #20 0x00007fffad114bfa in ScDocument::SetNumberFormat (this=0x1c74100, rPos=..., nNumberFormat=99) at co-24.04/sc/source/core/data/document.cxx:3727
 #21 0x00007fffad356c65 in ScFormulaCell::InterpretTail (this=0x1cf9800, rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
     at co-24.04/sc/source/core/data/formulacell.cxx:2157
 #22 0x00007fffad354e67 in ScFormulaCell::Interpret (this=0x1cf9800, nStartOffset=-1, nEndOffset=-1) at co-24.04/sc/source/core/data/formulacell.cxx:1619
 #23 0x00007fffacf8e59f in ScFormulaCell::MaybeInterpret (this=0x1cf9800) at co-24.04/sc/inc/formulacell.hxx:470
 #24 0x00007fffad358dd4 in ScFormulaCell::IsValue (this=0x1cf9800) at co-24.04/sc/source/core/data/formulacell.cxx:2762
 #25 0x00007fffad025e1b in lcl_GetCellContent (rCell=..., bIsStr1=false, rArg=@0x7fffffff9208: 0, rArgStr="", pDoc=0x1c74100)
     at co-24.04/sc/source/core/data/conditio.cxx:764
 #26 0x00007fffad0286c5 in ScConditionEntry::IsCellValid (this=0x7fff9c1c73f0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1263
 #27 0x00007fffad02b18c in ScConditionalFormat::GetCellStyle (this=0x7fff9c02c1d0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1863
 #28 0x00007fffad0d20f8 in ScDocument::GetCondResult (this=0x1c74100, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:827
 #29 0x00007fffad0d1f91 in ScDocument::GetCondResult (this=0x1c74100, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809

very probably this is a problem since ItemSet rework of:

commit 2b4cb63
CommitDate: Tue Nov 21 16:08:57 2023 +0100

    Cleanup some ScPatternAttr specific stuff

or similar of that sequence, and likely fixed in upstream later by:

Author:     Armin Le Grand (allotropia) <[email protected]>
CommitDate: Thu Dec 28 19:38:15 2023 +0100

    Decouple ScPatternAttr from SfxItemPool

but that's a very sizable rework, so here apply a conservative simpler
workaround to avoid the crash.

Change-Id: I309953015d39bce4796a2cf99666603b00c34d24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178579
Reviewed-by: Andras Timar <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 25, 2024
Instead of deleting the QDialog owned by the
QtInstanceDialog in the QtInstanceDialog dtor
right away by calling std::unique_ptr<QDialog>::reset,
instead mark the object for deletion by calling
QObject::deleteLater [1] on the dialog object, which schedules
the object for deletion when control returns to the event
loop.

Also switch QtInstanceDialog::m_pDialog from a unique_ptr
to a plain QDialog*.

This fixes crashes seen with the current qtbase git dev branch
after qtbase commit

    commit 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
    Author: Shawn Rutledge <[email protected]>
    Date:   Tue Nov 12 10:04:31 2024 +0100

        Move QContextMenuEvent synthesis from QWidgetWindow to QWindow

The crash was quite reproducible for me by running LO with the qt6 VCL
plugin and SAL_VCL_QT_USE_WELDED_WIDGETS=1 (to enable use of
native Qt widgets), opening the "Help" -> "About LibreOfficeDev"
dialog and closing it by clicking the "Close" button with the
left mouse button.

Backtrace of the crash:

    (rr) bt
    #0  0x0000000000000000 in ??? ()
    #1  0x000019667a96b92f in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:675
    #2  0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #3  0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #4  0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #5  0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #6  0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #7  0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #8  0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #9  0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #10 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #11 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #12 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #13 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #14 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #15 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #16 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #17 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #18 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #19 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #20 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #21 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #22 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #23 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #24 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #25 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #26 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #27 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #28 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

The segfault happens when calling

    d->maybeSynthesizeContextMenuEvent(event);

, i.e the virtual QWindowPrivate::maybeSynthesizeContextMenuEvent.
This is because the QWidgetWindow object and its QWidgetPrivate
have already been deleted when processing an earlier event
triggered by the mouse click, see backtrace below.

Not deleting the object right away but marking it for deletion later
makes sure the object is still valid when the event gets processed,
and then deleted afterwards.

Backtrace of how the QWindowPrivate object got deleted earlier
(reverse-debugged with rr) - see frame 17 for the dtor (i.e. the
code that was adjusted in this commit now to fix the problem):

    Thread 1 hit Breakpoint 1.1, QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    211     QWindowPrivate::~QWindowPrivate()
    (rr) p this
    $6 = (QWindowPrivate *) 0x564896397450
    (rr) bt
    #0  QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    #1  0x000019667a96f039 in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #2  0x000019667a96f05d in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #3  0x00006f736e33a7e8 in QScopedPointerDeleter<QObjectData>::cleanup (pointer=0x564896397450) at qtbase/src/corelib/tools/qscopedpointer.h:24
    #4  0x00006f736e32e134 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer (this=0x5648961bd088) at qtbase/src/corelib/tools/qscopedpointer.h:81
    #5  0x00006f736e31cdb2 in QObject::~QObject (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1149
    #6  0x00005557579435ec in QWindow::~QWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:206
    #7  0x000019667a969be6 in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:179
    #8  0x000019667a969c2d in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:160
    #9  0x000019667a915351 in QWidgetPrivate::deleteTLSysExtra (this=0x564894d40bf0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1711
    #10 0x000019667a914f86 in QWidget::destroy (this=0x56488f3e8100, destroyWindow=true, destroySubWindows=true) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:12612
    #11 0x000019667a914504 in QWidget::~QWidget (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1565
    #12 0x000019667ad11705 in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:394
    #13 0x000019667ad1174d in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:386
    #14 0x00006a0d3b71e358 in std::default_delete<QDialog>::operator() (this=0x5648963f9fb0, __ptr=0x56488f3e8100) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #15 0x00006a0d3b71e478 in std::__uniq_ptr_impl<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:205
    #16 0x00006a0d3b71e40d in std::unique_ptr<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #17 0x00006a0d3b71b550 in QtInstanceDialog::~QtInstanceDialog()::$_0::operator()() const (this=0x7ffe9cb13630) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #18 0x00006a0d3b71b525 in std::__invoke_impl<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(std::__invoke_other, QtInstanceDialog::~QtInstanceDialog()::$_0&) (__f=...)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:61
    #19 0x00006a0d3b71b4d5 in std::__invoke_r<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(QtInstanceDialog::~QtInstanceDialog()::$_0&) (__fn=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:111
    #20 0x00006a0d3b71b3fd in std::_Function_handler<void(), QtInstanceDialog::~QtInstanceDialog()::$_0>::_M_invoke (__functor=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:290
    #21 0x00006a0d3b6e278e in std::function<void()>::operator() (this=0x7ffe9cb13630) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591
    #22 0x00006a0d3b6da31a in QtInstance::RunInMainThread (this=0x56488e111bf0, func=...) at vcl/qt6/../qt5/QtInstance.cxx:226
    #23 0x00006a0d3b71947b in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90, vtt=0x6a0d3b98fec8 <VTT for QtInstanceDialog>) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #24 0x00006a0d3b7195a0 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #25 0x00006a0d3b7196a9 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #26 0x00005abe4e4746f8 in std::default_delete<weld::Dialog>::operator() (this=0x564896171890, __ptr=0x5648963fa1f8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #27 0x00005abe4e4faefd in std::_Sp_counted_deleter<weld::Dialog*, std::default_delete<weld::Dialog>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x564896171880)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:527
    #28 0x00005abe4da1978a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x564896171880) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:346
    #29 0x00005abe4da19706 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5648961a7cb8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #30 0x00005abe4db3d6e9 in std::__shared_ptr<weld::Dialog, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #31 0x00005abe4db2e905 in std::shared_ptr<weld::Dialog>::~shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr.h:175
    #32 0x00005abe4e4f6a7b in weld::GenericDialogController::~GenericDialogController (this=0x5648961a7c90) at vcl/source/app/weldutils.cxx:58
    #33 0x000000444e3b8ce9 in AboutDialog::~AboutDialog (this=0x5648961a7c90) at cui/source/dialogs/about.cxx:142
    #34 0x000000444e5787b6 in std::destroy_at<AboutDialog> (__location=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:88
    #35 0x000000444e578795 in std::_Destroy<AboutDialog> (__pointer=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:149
    #36 0x000000444e57862f in std::allocator_traits<std::allocator<void> >::destroy<AboutDialog> (__p=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/alloc_traits.h:708
    #37 std::_Sp_counted_ptr_inplace<AboutDialog, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:616
    #38 0x00006a0d3b661e5a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:175
    #39 0x00006a0d3b661e35 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:199
    #40 0x00006a0d3b661e11 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:353
    #41 0x00006a0d3b661cf6 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffe9cb13a30) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #42 0x00006a0d3b71ea39 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffe9cb13a28) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #43 0x00006a0d3b71da14 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::reset (this=0x7ffe9cb13ae8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1643
    #44 0x00006a0d3b71ae1c in QtInstanceDialog::dialogFinished (this=0x5648963f9f90, nResult=7) at vcl/qt6/../qt5/QtInstanceDialog.cxx:198
    #45 0x00006a0d3b71e9a6 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb13bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #46 0x00006a0d3b71e8c9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}&&) (args=0x7ffe9cb13fa0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #47 0x00006a0d3b71e803 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call
        (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #48 0x00006a0d3b71e77d in QtPrivate::FunctionPointer<void (QtInstanceDialog::*)(int)>::call<QtPrivate::List<int>, void> (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #49 0x00006a0d3b71e6a6 in QtPrivate::QCallableObject<void (QtInstanceDialog::*)(int), QtPrivate::List<int>, void>::impl (which=1, this_=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0, ret=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #50 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #51 0x00006f736e331854 in doActivate<false> (sender=0x56488f3e8100, signal_index=7, argv=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #52 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488f3e8100, m=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, argv=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #53 0x000019667a86520b in QMetaObject::activate<void, int> (sender=0x56488f3e8100, mo=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, ret=0x0, args=@0x7ffe9cb13fe4: 7) at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #54 0x000019667ad11f28 in QDialog::finished (this=0x56488f3e8100, _t1=7) at qtbase/src/widgets/Widgets_autogen/include/moc_qdialog.cpp:191
    #55 0x000019667ad11e55 in QDialog::done (this=0x56488f3e8100, r=7) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:617
    #56 0x00006a0d3b71b173 in QtInstanceDialog::handleButtonClick (rDialog=..., rButton=...) at vcl/qt6/../qt5/QtInstanceDialog.cxx:226
    #57 0x00006a0d3b658b0c in QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0::operator()() const (this=0x5648961351a0)
        at vcl/qt6/../qt5/QtBuilder.cxx:528
    #58 0x00006a0d3b658ae8 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_v--Type <RET> for more, q to quit, c to continue without paging--
    iew<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb14370) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:116
    #59 0x00006a0d3b658ac9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}&&) (args=0x7ffe9cb146d0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #60 0x00006a0d3b658a92 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)
        (f=..., arg=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:115
    #61 0x00006a0d3b658a41 in QtPrivate::FunctorCallable<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call<QtPrivate::List<>, void>(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void*, void**) (f=..., arg=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:337
    #62 0x00006a0d3b6589e8 in QtPrivate::QCallableObject<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0, ret=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:547
    #63 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #64 0x00006f736e331854 in doActivate<false> (sender=0x56489581c360, signal_index=9, argv=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #65 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56489581c360, m=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, argv=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #66 0x000019667a86538b in QMetaObject::activate<void, bool> (sender=0x56489581c360, mo=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, ret=0x0, args=@0x7ffe9cb14717: false)
        at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #67 0x000019667aab4f52 in QAbstractButton::clicked (this=0x56489581c360, _t1=false) at qtbase/src/widgets/Widgets_autogen/include/moc_qabstractbutton.cpp:253
    #68 0x000019667aab4e67 in QAbstractButtonPrivate::emitClicked (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:381
    #69 0x000019667aab4cc1 in QAbstractButtonPrivate::click (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:374
    #70 0x000019667aab616f in QAbstractButton::mouseReleaseEvent (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:976
    #71 0x000019667a92c6fd in QWidget::event (this=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8971
    #72 0x000019667aab5f8c in QAbstractButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:933
    #73 0x000019667ac2dfb1 in QPushButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qpushbutton.cpp:684
    #74 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #75 0x000019667a871ae2 in QApplication::notify (this=0x56488e067420, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2781
    #76 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #77 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #78 0x000019667a870737 in QApplicationPrivate::sendMouseEvent
        (receiver=0x56489581c360, event=0x7ffe9cb15ad0, alienWidget=0x56489581c360, nativeWidget=0x56488f3e8100, buttonDown=0x19667b45b488 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
        at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2362
    #79 0x000019667a96b8bb in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:664
    #80 0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #81 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #82 0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #83 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #84 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #85 0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #86 0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #87 0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #88 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #89 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #90 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #91 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #92 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #93 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #94 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #95 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #96 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #97 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #98 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #99 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #100 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #101 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #102 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #103 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #104 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #105 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #106 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

[1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=84a5f50c7766c99f62b22bb4388137e0aa8dd13d

Change-Id: I3f547c1b1c1581d2f3ae092f2034d930640b0f48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179312
Reviewed-by: Michael Weghorn <[email protected]>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Dec 26, 2024
Instead of deleting the QDialog owned by the
QtInstanceDialog in the QtInstanceDialog dtor
right away by calling std::unique_ptr<QDialog>::reset,
instead mark the object for deletion by calling
QObject::deleteLater [1] on the dialog object, which schedules
the object for deletion when control returns to the event
loop.

Also switch QtInstanceDialog::m_pDialog from a unique_ptr
to a plain QDialog*.

This fixes crashes seen with the current qtbase git dev branch
after qtbase commit

    commit 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
    Author: Shawn Rutledge <[email protected]>
    Date:   Tue Nov 12 10:04:31 2024 +0100

        Move QContextMenuEvent synthesis from QWidgetWindow to QWindow

The crash was quite reproducible for me by running LO with the qt6 VCL
plugin and SAL_VCL_QT_USE_WELDED_WIDGETS=1 (to enable use of
native Qt widgets), opening the "Help" -> "About LibreOfficeDev"
dialog and closing it by clicking the "Close" button with the
left mouse button.

Backtrace of the crash:

    (rr) bt
    #0  0x0000000000000000 in ??? ()
    #1  0x000019667a96b92f in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:675
    #2  0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #3  0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #4  0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #5  0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #6  0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #7  0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #8  0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #9  0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #10 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #11 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #12 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #13 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #14 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #15 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #16 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #17 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #18 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #19 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #20 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #21 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #22 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #23 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #24 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #25 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #26 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #27 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #28 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

The segfault happens when calling

    d->maybeSynthesizeContextMenuEvent(event);

, i.e the virtual QWindowPrivate::maybeSynthesizeContextMenuEvent.
This is because the QWidgetWindow object and its QWidgetPrivate
have already been deleted when processing an earlier event
triggered by the mouse click, see backtrace below.

Not deleting the object right away but marking it for deletion later
makes sure the object is still valid when the event gets processed,
and then deleted afterwards.

Backtrace of how the QWindowPrivate object got deleted earlier
(reverse-debugged with rr) - see frame 17 for the dtor (i.e. the
code that was adjusted in this commit now to fix the problem):

    Thread 1 hit Breakpoint 1.1, QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    211     QWindowPrivate::~QWindowPrivate()
    (rr) p this
    $6 = (QWindowPrivate *) 0x564896397450
    (rr) bt
    #0  QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    #1  0x000019667a96f039 in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #2  0x000019667a96f05d in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #3  0x00006f736e33a7e8 in QScopedPointerDeleter<QObjectData>::cleanup (pointer=0x564896397450) at qtbase/src/corelib/tools/qscopedpointer.h:24
    #4  0x00006f736e32e134 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer (this=0x5648961bd088) at qtbase/src/corelib/tools/qscopedpointer.h:81
    #5  0x00006f736e31cdb2 in QObject::~QObject (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1149
    #6  0x00005557579435ec in QWindow::~QWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:206
    #7  0x000019667a969be6 in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:179
    #8  0x000019667a969c2d in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:160
    #9  0x000019667a915351 in QWidgetPrivate::deleteTLSysExtra (this=0x564894d40bf0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1711
    #10 0x000019667a914f86 in QWidget::destroy (this=0x56488f3e8100, destroyWindow=true, destroySubWindows=true) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:12612
    #11 0x000019667a914504 in QWidget::~QWidget (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1565
    #12 0x000019667ad11705 in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:394
    #13 0x000019667ad1174d in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:386
    #14 0x00006a0d3b71e358 in std::default_delete<QDialog>::operator() (this=0x5648963f9fb0, __ptr=0x56488f3e8100) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #15 0x00006a0d3b71e478 in std::__uniq_ptr_impl<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:205
    #16 0x00006a0d3b71e40d in std::unique_ptr<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #17 0x00006a0d3b71b550 in QtInstanceDialog::~QtInstanceDialog()::$_0::operator()() const (this=0x7ffe9cb13630) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #18 0x00006a0d3b71b525 in std::__invoke_impl<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(std::__invoke_other, QtInstanceDialog::~QtInstanceDialog()::$_0&) (__f=...)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:61
    #19 0x00006a0d3b71b4d5 in std::__invoke_r<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(QtInstanceDialog::~QtInstanceDialog()::$_0&) (__fn=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:111
    #20 0x00006a0d3b71b3fd in std::_Function_handler<void(), QtInstanceDialog::~QtInstanceDialog()::$_0>::_M_invoke (__functor=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:290
    #21 0x00006a0d3b6e278e in std::function<void()>::operator() (this=0x7ffe9cb13630) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591
    #22 0x00006a0d3b6da31a in QtInstance::RunInMainThread (this=0x56488e111bf0, func=...) at vcl/qt6/../qt5/QtInstance.cxx:226
    #23 0x00006a0d3b71947b in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90, vtt=0x6a0d3b98fec8 <VTT for QtInstanceDialog>) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #24 0x00006a0d3b7195a0 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #25 0x00006a0d3b7196a9 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #26 0x00005abe4e4746f8 in std::default_delete<weld::Dialog>::operator() (this=0x564896171890, __ptr=0x5648963fa1f8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #27 0x00005abe4e4faefd in std::_Sp_counted_deleter<weld::Dialog*, std::default_delete<weld::Dialog>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x564896171880)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:527
    #28 0x00005abe4da1978a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x564896171880) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:346
    #29 0x00005abe4da19706 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5648961a7cb8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #30 0x00005abe4db3d6e9 in std::__shared_ptr<weld::Dialog, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #31 0x00005abe4db2e905 in std::shared_ptr<weld::Dialog>::~shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr.h:175
    #32 0x00005abe4e4f6a7b in weld::GenericDialogController::~GenericDialogController (this=0x5648961a7c90) at vcl/source/app/weldutils.cxx:58
    #33 0x000000444e3b8ce9 in AboutDialog::~AboutDialog (this=0x5648961a7c90) at cui/source/dialogs/about.cxx:142
    #34 0x000000444e5787b6 in std::destroy_at<AboutDialog> (__location=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:88
    #35 0x000000444e578795 in std::_Destroy<AboutDialog> (__pointer=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:149
    #36 0x000000444e57862f in std::allocator_traits<std::allocator<void> >::destroy<AboutDialog> (__p=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/alloc_traits.h:708
    #37 std::_Sp_counted_ptr_inplace<AboutDialog, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:616
    #38 0x00006a0d3b661e5a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:175
    #39 0x00006a0d3b661e35 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:199
    #40 0x00006a0d3b661e11 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:353
    #41 0x00006a0d3b661cf6 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffe9cb13a30) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #42 0x00006a0d3b71ea39 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffe9cb13a28) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #43 0x00006a0d3b71da14 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::reset (this=0x7ffe9cb13ae8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1643
    #44 0x00006a0d3b71ae1c in QtInstanceDialog::dialogFinished (this=0x5648963f9f90, nResult=7) at vcl/qt6/../qt5/QtInstanceDialog.cxx:198
    #45 0x00006a0d3b71e9a6 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb13bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #46 0x00006a0d3b71e8c9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}&&) (args=0x7ffe9cb13fa0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #47 0x00006a0d3b71e803 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call
        (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #48 0x00006a0d3b71e77d in QtPrivate::FunctionPointer<void (QtInstanceDialog::*)(int)>::call<QtPrivate::List<int>, void> (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #49 0x00006a0d3b71e6a6 in QtPrivate::QCallableObject<void (QtInstanceDialog::*)(int), QtPrivate::List<int>, void>::impl (which=1, this_=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0, ret=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #50 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #51 0x00006f736e331854 in doActivate<false> (sender=0x56488f3e8100, signal_index=7, argv=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #52 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488f3e8100, m=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, argv=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #53 0x000019667a86520b in QMetaObject::activate<void, int> (sender=0x56488f3e8100, mo=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, ret=0x0, args=@0x7ffe9cb13fe4: 7) at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #54 0x000019667ad11f28 in QDialog::finished (this=0x56488f3e8100, _t1=7) at qtbase/src/widgets/Widgets_autogen/include/moc_qdialog.cpp:191
    #55 0x000019667ad11e55 in QDialog::done (this=0x56488f3e8100, r=7) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:617
    #56 0x00006a0d3b71b173 in QtInstanceDialog::handleButtonClick (rDialog=..., rButton=...) at vcl/qt6/../qt5/QtInstanceDialog.cxx:226
    #57 0x00006a0d3b658b0c in QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0::operator()() const (this=0x5648961351a0)
        at vcl/qt6/../qt5/QtBuilder.cxx:528
    #58 0x00006a0d3b658ae8 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_v--Type <RET> for more, q to quit, c to continue without paging--
    iew<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb14370) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:116
    #59 0x00006a0d3b658ac9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}&&) (args=0x7ffe9cb146d0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #60 0x00006a0d3b658a92 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)
        (f=..., arg=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:115
    #61 0x00006a0d3b658a41 in QtPrivate::FunctorCallable<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call<QtPrivate::List<>, void>(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void*, void**) (f=..., arg=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:337
    #62 0x00006a0d3b6589e8 in QtPrivate::QCallableObject<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0, ret=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:547
    #63 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #64 0x00006f736e331854 in doActivate<false> (sender=0x56489581c360, signal_index=9, argv=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #65 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56489581c360, m=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, argv=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #66 0x000019667a86538b in QMetaObject::activate<void, bool> (sender=0x56489581c360, mo=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, ret=0x0, args=@0x7ffe9cb14717: false)
        at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #67 0x000019667aab4f52 in QAbstractButton::clicked (this=0x56489581c360, _t1=false) at qtbase/src/widgets/Widgets_autogen/include/moc_qabstractbutton.cpp:253
    #68 0x000019667aab4e67 in QAbstractButtonPrivate::emitClicked (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:381
    #69 0x000019667aab4cc1 in QAbstractButtonPrivate::click (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:374
    #70 0x000019667aab616f in QAbstractButton::mouseReleaseEvent (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:976
    #71 0x000019667a92c6fd in QWidget::event (this=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8971
    #72 0x000019667aab5f8c in QAbstractButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:933
    #73 0x000019667ac2dfb1 in QPushButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qpushbutton.cpp:684
    #74 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #75 0x000019667a871ae2 in QApplication::notify (this=0x56488e067420, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2781
    #76 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #77 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #78 0x000019667a870737 in QApplicationPrivate::sendMouseEvent
        (receiver=0x56489581c360, event=0x7ffe9cb15ad0, alienWidget=0x56489581c360, nativeWidget=0x56488f3e8100, buttonDown=0x19667b45b488 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
        at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2362
    #79 0x000019667a96b8bb in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:664
    #80 0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #81 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #82 0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #83 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #84 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #85 0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #86 0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #87 0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #88 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #89 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #90 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #91 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #92 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #93 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #94 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #95 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #96 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #97 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #98 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #99 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #100 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #101 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #102 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #103 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #104 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #105 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #106 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

[1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=84a5f50c7766c99f62b22bb4388137e0aa8dd13d

Change-Id: I3f547c1b1c1581d2f3ae092f2034d930640b0f48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179312
Reviewed-by: Michael Weghorn <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 4b547f1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179325
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 29, 2024
This reverts commit 687080c, as it caused e.g.
CppunitTest_sw_docbookexport to fail with

> sw/inc/calbck.hxx:428:18: runtime error: downcast of address 0x7ba8053a9db8 which does not point to an object of type 'SwClient' (aka 'ClientBase<SwModify>')
> 0x7ba8053a9da0: note: object is base class subobject at offset 24 within object of type 'SwFormatHeader'
>  00 00 00 00  d0 8b c9 ae 47 7b 00 00  01 00 00 00 66 00 48 01  40 6c 00 00 88 be be be  50 8c c9 ae
>               ^                                                                          ~~~~~~~~~~~
>                                                                                          vptr for 'sw::ClientBase<SwFrameFormat>' base class of 'SwFormatHeader'
>  #0 in SwIterator<sw::ClientBase<SwModify>, SwModify, (sw::IteratorMode)0>::First() at sw/inc/calbck.hxx:428:18
>  #1 in SwModify::CallSwClientNotify(SfxHint const&) const at sw/source/core/attr/calbck.cxx:237:35
>  #2 in sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const at sw/source/core/attr/calbck.cxx:259:15
>  #3 in SwModify::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/attr/calbck.cxx:229:5
>  #4 in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/attr/format.cxx:309:19
>  #5 in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/layout/atrfrm.cxx:2849:15
>  #6 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet const&, SwAttrSet&, SwAttrSet&) at sw/source/core/attr/calbck.cxx:268:13
>  #7 in SwFormat::SetFormatAttr(SfxItemSet const&) at sw/source/core/attr/format.cxx:604:13
>  #8 in FillHdFt(SwFrameFormat*, SfxItemSet const&) at sw/source/uibase/utlui/uitool.cxx:239:14
>  #9 in ItemSetToPageDesc(SfxItemSet const&, SwPageDesc&) at sw/source/uibase/utlui/uitool.cxx:340:13
>  #10 in SwDocStyleSheet::SetItemSet(SfxItemSet const&, bool, bool) at sw/source/uibase/app/docstyle.cxx:1894:13
>  #11 in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) at sw/source/core/unocore/unostyle.cxx:3157:33
>  #12 in SwXPageStyle::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) at sw/source/core/unocore/unostyle.cxx:3453:5
>  #13 in writerfilter::dmapper::DomainMapper_Impl::PushPageHeaderFooter(writerfilter::dmapper::PagePartType, writerfilter::dmapper::PageType) at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:3910:25
>  #14 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10049:13
>  #15 in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/DomainMapper.cxx:4746:14
>  #16 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/LoggedResources.cxx:272:5
>  #17 in writerfilter::ooxml::OOXMLDocumentImpl::resolveFastSubStreamWithId(writerfilter::Stream&, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&, unsigned int) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:127:13
>  #18 in writerfilter::ooxml::OOXMLDocumentImpl::resolveHeader(writerfilter::Stream&, int, rtl::OUString const&) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:384:10
>  #19 in writerfilter::ooxml::OOXMLFastContextHandler::resolveHeader(int, rtl::OUString const&) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:895:35
>  #20 in writerfilter::ooxml::OOXMLHeaderHandler::finalize() at sw/source/writerfilter/ooxml/Handler.cxx:214:20
>  #21 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::handleHdrFtr() at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:1117:28
>  #22 in writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at workdir/CustomTarget/sw/source/writerfilter/ooxml/OOXMLFactory_wml.cxx:7530:26
>  #23 in writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at sw/source/writerfilter/ooxml/OOXMLFactory.cxx:157:19
>  #24 in writerfilter::ooxml::OOXMLFastContextHandler::endAction() at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:320:5
>  #25 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::lcl_endFastElement(int) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:1038:9
>  #26 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:227:9
>  #27 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27
>  #28 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1338:17
>  #29 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18
>  #30 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11254:8
>  #31 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:11636:5
>  #32 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1117:25
>  #33 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:896:9
>  #34 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1477:13
>  #35 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:514:18
>  #36 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sw/source/writerfilter/filter/WriterFilter.cxx:210:24
>  #37 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2719:34
>  #38 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:767:23
>  #39 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1991:36
>  #40 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:725:28
>  #41 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1180:37
>  #42 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:415:20
>  #43 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) at framework/source/loadenv/loadenv.cxx:311:5
>  #44 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:167:14
>  #45 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:592:16
>  #46 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx
>  #47 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:72:62
>  #48 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19
>  #49 in UnoApiTest::loadFromURL(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5
>  #50 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:384:5
>  #51 in SwModelTestBase::createSwDoc(char const*, char const*) at sw/qa/unit/swmodeltestbase.cxx:433:9
>  #52 in (anonymous namespace)::testtdf91095::TestBody() at sw/qa/extras/docbookexport/docbookexport.cxx:35:5

Change-Id: I1e6d6888c8b311988e627845107148c7970fbaab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179502
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 8, 2025
This reverts commit cc56bf5.

Reason for revert: It causes CppunitTest_sw_uwriter
CPPUNIT_TEST_NAME=SwDocTest::test64kPageDescs to fail with

> /sw/source/core/attr/format.cxx:273:29: runtime error: downcast of address 0x6140000e1840 which does not point to an object of type 'SwFormat'
> 0x6140000e1840: note: object is of type 'SwModify'
>  00 00 00 00  b0 e1 74 97 df 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SwModify'
>     #0 0x7fdf8a31ca65 in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/format.cxx:273:29
>     #1 0x7fdf8d066efe in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2766:19
>     #2 0x7fdf8a2d51f2 in SwModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:231:18
>     #3 0x7fdf8a2d2c5a in SwModify::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:222:5
>     #4 0x7fdf8a2d07bd in SwModify::~SwModify() /sw/source/core/attr/calbck.cxx:145:15
>     #5 0x7fdf89b267c5 in sw::BroadcastingModify::~BroadcastingModify() /sw/inc/calbck.hxx:242:59
>     #6 0x7fdf8a319f52 in SwFormat::~SwFormat() /sw/source/core/attr/format.cxx:208:1
>     #7 0x7fdf8d064426 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2705:1
>     #8 0x7fdf8d0644d8 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2677:1
>     #9 0x7fdf8b42be68 in std::default_delete<SwFrameFormat>::operator()(SwFrameFormat*) const /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:95:2
>     #10 0x7fdf8b454cc4 in std::__uniq_ptr_impl<SwFrameFormat, std::default_delete<SwFrameFormat> >::reset(SwFrameFormat*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:203:4
>     #11 0x7fdf8b38aa7e in std::unique_ptr<SwFrameFormat, std::default_delete<SwFrameFormat> >::reset(SwFrameFormat*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:501:7
>     #12 0x7fdf8b3434a6 in SwDoc::~SwDoc() /sw/source/core/doc/docnew.cxx:625:23
>     #13 0x7fdf8abc1dd5 in SwDoc::release() /sw/source/core/doc/doc.cxx:136:9
>     #14 0x7fdf8c2cbc16 in rtl::Reference<SwDoc>::clear() /include/rtl/ref.hxx:193:19
>     #15 0x7fdf9102a534 in SwDocShell::RemoveLink() /sw/source/uibase/app/docshini.cxx:445:16
>     #16 0x7fdf910295bd in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:373:5
>     #17 0x7fdf9102a728 in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:363:1
>     #18 0x7fdfda648fca in cppu::OWeakObject::release() /cppuhelper/source/weak.cxx:230:9
>     #19 0x7fdf89b2801f in rtl::Reference<SwDocShell>::clear() /include/rtl/ref.hxx:193:19
>     #20 0x7fdf89ac3f0c in SwDocTest::tearDown() /sw/qa/core/uwriter.cxx:1977:17

(<https://ci.libreoffice.org/job/lo_ubsan/3425/>)

Change-Id: Ib4866bcfc71e2e3358a8f860cc19efa3f6349885
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179925
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 8, 2025
…"" and fix SwIterator cast"

This reverts commit d8e29e2.

Reason for revert: It causes CppunitTest_sw_rtfexport2 to fail with

> /sw/inc/calbck.hxx:428:18: runtime error: downcast of address 0x6060004d0fd8 which does not point to an object of type 'sw::ClientBase<SwModify>'
> 0x6060004d0fc0: note: object is base class subobject at offset 24 within object of type 'SwFormatHeader'
>  00 00 00 00  90 c6 d3 ea 6e 7f 00 00  01 00 00 00 66 00 48 01  a0 11 00 00 88 be be be  10 c7 d3 ea
>               ^                                                                          ~~~~~~~~~~~
>                                                                                          vptr for 'sw::ClientBase<SwFrameFormat>' base class of 'SwFormatHeader'
>     #0 0x7f6edd5beb5e in SwIterator<sw::ClientBase<SwModify>, SwModify, (sw::IteratorMode)0>::First() /sw/inc/calbck.hxx:428:18
>     #1 0x7f6edd5b6d69 in SwModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:237:35
>     #2 0x7f6edd5b7c45 in sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:259:15
>     #3 0x7f6edd5b49c6 in SwModify::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:229:5
>     #4 0x7f6edd605e7b in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/format.cxx:309:19
>     #5 0x7f6ee039738b in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2849:15
>     #6 0x7f6edd5b8189 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet const&, SwAttrSet&, SwAttrSet&) /sw/source/core/attr/calbck.cxx:268:13
>     #7 0x7f6edd610879 in SwFormat::SetFormatAttr(SfxItemSet const&) /sw/source/core/attr/format.cxx:604:13
>     #8 0x7f6ee6495964 in FillHdFt(SwFrameFormat*, SfxItemSet const&) /sw/source/uibase/utlui/uitool.cxx:239:14
>     #9 0x7f6ee64914e7 in ItemSetToPageDesc(SfxItemSet const&, SwPageDesc&) /sw/source/uibase/utlui/uitool.cxx:340:13
>     #10 0x7f6ee43fe5b4 in SwDocStyleSheet::SetItemSet(SfxItemSet const&, bool, bool) /sw/source/uibase/app/docstyle.cxx:1894:13
>     #11 0x7f6ee304306c in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) /sw/source/core/unocore/unostyle.cxx:3157:33
>     #12 0x7f6ee304d9b9 in SwXPageStyle::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) /sw/source/core/unocore/unostyle.cxx:3453:5
>     #13 0x7f6e9b369897 in writerfilter::dmapper::DomainMapper_Impl::PushPageHeaderFooter(writerfilter::dmapper::PagePartType, writerfilter::dmapper::PageType) /sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:3910:25
>     #14 0x7f6e9b445050 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream> > const&) /sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10046:13
>     #15 0x7f6e9b101b9d in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream> > const&) /sw/source/writerfilter/dmapper/DomainMapper.cxx:4746:14
>     #16 0x7f6e9b877f73 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream> > const&) /sw/source/writerfilter/dmapper/LoggedResources.cxx:272:5
>     #17 0x7f6e9ad35daf in writerfilter::rtftok::RTFDocumentImpl::resolveSubstream(unsigned long, unsigned int, rtl::OUString const&) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:381:14
>     #18 0x7f6e9ad33bc1 in writerfilter::rtftok::RTFDocumentImpl::resolveSubstream(unsigned long, unsigned int) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:356:5
>     #19 0x7f6e9ad48f49 in writerfilter::rtftok::RTFDocumentImpl::sectBreak(bool) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:705:9
>     #20 0x7f6e9adcd3b7 in writerfilter::rtftok::RTFDocumentImpl::popState() /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:3695:13
>     #21 0x7f6e9afd2595 in writerfilter::rtftok::RTFTokenizer::resolveParse() /sw/source/writerfilter/rtftok/rtftokenizer.cxx:2011:37
>     #22 0x7f6e9ad4ef4f in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:844:27
>     #23 0x7f6e9bd39f91 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sw/source/writerfilter/filter/RtfFilter.cxx:164:20
>     #24 0x7f6ef659a6a4 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2719:34
>     #25 0x7f6ef654cf40 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:767:23
>     #26 0x7f6ef67df024 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1991:36
>     #27 0x7f6ef703d0f0 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:725:28
>     #28 0x7f6ec073ee16 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1180:37
>     #29 0x7f6ec0735cb2 in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:415:20
>     #30 0x7f6ec072e172 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:311:5
>     #31 0x7f6ec0729554 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:167:14
>     #32 0x7f6ec07fe176 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:592:16
>     #33 0x7f6ec07fe396 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx
>     #34 0x7f6ed3d9c8c9 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:72:62
>     #35 0x7f6ef13e8d62 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
>     #36 0x7f6ef13e7e98 in UnoApiTest::loadFromURL(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
>     #37 0x7f6efe61e0c7 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) /sw/qa/unit/swmodeltestbase.cxx:384:5
>     #38 0x7f6efe632c07 in SwModelTestBase::createSwDoc(char const*, char const*) /sw/qa/unit/swmodeltestbase.cxx:433:9
>     #39 0x7f6efe0c635f in (anonymous namespace)::testAllGapsWord::TestBody() /sw/qa/extras/rtfexport/rtfexport2.cxx:771:5

(<https://ci.libreoffice.org/job/lo_ubsan/3418/>)

Change-Id: I70bd88050887c8b6c747707f2ea3b89802c7b468
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179946
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 10, 2025
...when generating Python/deepfreeze/deepfreeze.c during the build of
ExternalProject_python3 after 5052448 "Python:
upgrade to 3.11.11 (master only)",

> Objects/dictobject.c:1500:40: runtime error: load of misaligned address 0x555853494d81 for type 'PyDictUnicodeEntry *', which requires 8 byte alignment
> 0x555853494d81: note: pointer points here
>  00 00 00  ff ff ff ff ff ff ff ff  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
>               ^
>  #0 in dictresize at workdir/UnpackedTarball/python3/Objects/dictobject.c:1500:21
>  #1 in dict_merge at workdir/UnpackedTarball/python3/Objects/dictobject.c:2880:17
>  #2 in _PyDict_MergeEx at workdir/UnpackedTarball/python3/Objects/dictobject.c:3003:12
>  #3 in _PyEval_EvalFrameDefault at workdir/UnpackedTarball/python3/Python/ceval.c:3432:17
>  #4 in _PyEval_EvalFrame at workdir/UnpackedTarball/python3/./Include/internal/pycore_ceval.h:73:16
>  #5 in _PyEval_Vector at workdir/UnpackedTarball/python3/Python/ceval.c:6434:24
>  #6 in _PyFunction_Vectorcall at workdir/UnpackedTarball/python3/Objects/call.c:393:16
>  #7 in _PyObject_FastCallDictTstate at workdir/UnpackedTarball/python3/Objects/call.c:141:15
>  #8 in _PyObject_Call_Prepend at workdir/UnpackedTarball/python3/Objects/call.c:482:24
>  #9 in slot_tp_init at workdir/UnpackedTarball/python3/Objects/typeobject.c:7855:15
>  #10 in type_call at workdir/UnpackedTarball/python3/Objects/typeobject.c:1103:19
>  #11 in _PyObject_MakeTpCall at workdir/UnpackedTarball/python3/Objects/call.c:214:18
>  #12 in _PyObject_VectorcallTstate at workdir/UnpackedTarball/python3/./Include/internal/pycore_call.h:90:16
>  #13 in PyObject_Vectorcall at workdir/UnpackedTarball/python3/Objects/call.c:299:12
>  #14 in _PyEval_EvalFrameDefault at workdir/UnpackedTarball/python3/Python/ceval.c:4769:23
>  #15 in _PyEval_EvalFrame at workdir/UnpackedTarball/python3/./Include/internal/pycore_ceval.h:73:16
>  #16 in _PyEval_Vector at workdir/UnpackedTarball/python3/Python/ceval.c:6434:24
>  #17 in PyEval_EvalCode at workdir/UnpackedTarball/python3/Python/ceval.c:1148:21
>  #18 in run_eval_code_obj at workdir/UnpackedTarball/python3/Python/pythonrun.c:1741:9
>  #19 in run_mod at workdir/UnpackedTarball/python3/Python/pythonrun.c:1762:19
>  #20 in pyrun_file at workdir/UnpackedTarball/python3/Python/pythonrun.c:1657:15
>  #21 in _PyRun_SimpleFileObject at workdir/UnpackedTarball/python3/Python/pythonrun.c:440:13
>  #22 in _PyRun_AnyFileObject at workdir/UnpackedTarball/python3/Python/pythonrun.c:79:15
>  #23 in pymain_run_file_obj at workdir/UnpackedTarball/python3/Modules/main.c:360:15
>  #24 in pymain_run_file at workdir/UnpackedTarball/python3/Modules/main.c:379:15
>  #25 in pymain_run_python at workdir/UnpackedTarball/python3/Modules/main.c:605:21
>  #26 in Py_RunMain at workdir/UnpackedTarball/python3/Modules/main.c:684:5
>  #27 in main at workdir/UnpackedTarball/python3/Programs/_bootstrap_python.c:109:12

Change-Id: I0bacef11b5874bca6104516a206076a0505528ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180037
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 14, 2025
When using the qt6 vcl plugin with the Orca screen reader
running, selecting text in Writer resulted in a crash
due to an IndexOutOfBoundsException being thrown.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (rr) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f889b09ddef in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f889b049d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f889b0324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f889aca1a3d in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00007f889acb300a in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #6  0x00007f889aca15e9 in std::terminate() () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007f889acb3288 in __cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #8  0x00007f8862346900 in SwAccessibleSelectionHelper::throwIndexOutOfBoundsException (this=0x561f2f8d1910) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:72
    #9  0x00007f8862347df8 in SwAccessibleSelectionHelper::getSelectedAccessibleChild (this=0x561f2f8d1910, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:283
    #10 0x00007f8862298e6f in SwAccessibleDocument::getSelectedAccessibleChild (this=0x561f2f8d1800, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #11 0x00007f8862298eaf in non-virtual thunk to SwAccessibleDocument::getSelectedAccessibleChild(long) () at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #12 0x00007f88878c6200 in QtAccessibleWidget::selectedItem (this=0x7f887c014ac0, nSelectionIndex=0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:1861
    #13 0x00007f8885f08ba0 in AtSpiAdaptor::selectionInterface (this=0x561f2b8a7070, interface=0x7f887c014ac0, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:2596
    #14 0x00007f8885f03ce1 in AtSpiAdaptor::handleMessage (this=0x561f2b8a7070, message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1479
    #15 0x00007f888366d217 in QDBusConnectionPrivate::activateObject (this=0x7f887c00a390, node=..., msg=..., pathStartPos=27) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #16 0x00007f888366e1d0 in QDBusActivateObjectEvent::placeMetaCall (this=0x7f887c03aca0) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #17 0x00007f8886b09bb1 in QObject::event (this=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1431
    #18 0x00007f88849e2dd0 in QApplicationPrivate::notify_helper (this=0x561f2a554ae0, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #19 0x00007f88849e6ced in QApplication::notify (this=0x561f2a541420, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #20 0x00007f8886a481b9 in QCoreApplication::notifyInternal2 (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1118
    #21 0x00007f8886a48e29 in QCoreApplication::sendEvent (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1558
    #22 0x00007f8886a49d68 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x561f2a56fee0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1898
    #23 0x00007f8886a48c6c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1752
    #24 0x00007f88870377b1 in postEventSourceDispatch (s=0x561f2a5cce80) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
    #25 0x00007f888d50b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f888d50da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #27 0x00007f888d50e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #28 0x00007f88870369eb in QEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #29 0x00007f8886164858 in QPAEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #30 0x00007f888796a492 in QtInstance::ImplYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #31 0x00007f888796d511 in QtInstance::DoYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #32 0x00007f88924bd626 in ImplYield (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:385
    #33 0x00007f88924bcf3f in Application::Yield () at .../libreoffice/vcl/source/app/svapp.cxx:488
    #34 0x00007f88924bcd20 in Application::Execute () at .../libreoffice/vcl/source/app/svapp.cxx:360
    #35 0x00007f889b327b89 in desktop::Desktop::Main (this=0x7ffcd9ea1c00) at .../libreoffice/desktop/source/app/app.cxx:1679
    #36 0x00007f88924deaa6 in ImplSVMain () at .../libreoffice/vcl/source/app/svmain.cxx:230
    #37 0x00007f88924e0699 in SVMain () at .../libreoffice/vcl/source/app/svmain.cxx:248
    #38 0x00007f889b3a146a in soffice_main () at .../libreoffice/desktop/source/app/sofficemain.cxx:121
    #39 0x0000561ef2802a6d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #40 0x0000561ef2802a47 in main (argc=2, argv=0x7ffcd9ea1e08) at .../libreoffice/desktop/source/app/main.c:49

While QtAccessibleWidget::selectedItem already returns early
if the passed selection index is too large according to what
XAccessibleSelection::getSelectedAccessibleChildCount()
returns, this is not enough because Writer's SwAccessibleSelectionHelper
has an inconsistent/broken implementation:

SwAccessibleSelectionHelper::getSelectedAccessibleChildCount
returns the count of paragraphs that are (partially) selected
by the text cursor if no other objects are selected.
However, SwAccessibleSelectionHelper::getSelectedAccessibleChild
doesn't take these into account and therefore throws the
IndexOutOfBoundsException when called with any index.

Temporarily (in particular for backporting to release branches),
handle the exception in QtAccessibleWidget::selectedItem like
other a11y bridges do (see e.g. `selection_ref_selection`
for the gtk3 VCL plugin) to avoid the crash.

The underlying Writer issue described above will be fixed in a
separate commit (and for master only).

Change-Id: I874ad4a7a9faf79492967c943517d83df5f47e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180228
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 16, 2025
When using the qt6 vcl plugin with the Orca screen reader
running, selecting text in Writer resulted in a crash
due to an IndexOutOfBoundsException being thrown.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (rr) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f889b09ddef in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f889b049d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f889b0324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f889aca1a3d in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00007f889acb300a in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #6  0x00007f889aca15e9 in std::terminate() () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007f889acb3288 in __cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #8  0x00007f8862346900 in SwAccessibleSelectionHelper::throwIndexOutOfBoundsException (this=0x561f2f8d1910) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:72
    #9  0x00007f8862347df8 in SwAccessibleSelectionHelper::getSelectedAccessibleChild (this=0x561f2f8d1910, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:283
    #10 0x00007f8862298e6f in SwAccessibleDocument::getSelectedAccessibleChild (this=0x561f2f8d1800, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #11 0x00007f8862298eaf in non-virtual thunk to SwAccessibleDocument::getSelectedAccessibleChild(long) () at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #12 0x00007f88878c6200 in QtAccessibleWidget::selectedItem (this=0x7f887c014ac0, nSelectionIndex=0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:1861
    #13 0x00007f8885f08ba0 in AtSpiAdaptor::selectionInterface (this=0x561f2b8a7070, interface=0x7f887c014ac0, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:2596
    #14 0x00007f8885f03ce1 in AtSpiAdaptor::handleMessage (this=0x561f2b8a7070, message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1479
    #15 0x00007f888366d217 in QDBusConnectionPrivate::activateObject (this=0x7f887c00a390, node=..., msg=..., pathStartPos=27) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #16 0x00007f888366e1d0 in QDBusActivateObjectEvent::placeMetaCall (this=0x7f887c03aca0) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #17 0x00007f8886b09bb1 in QObject::event (this=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1431
    #18 0x00007f88849e2dd0 in QApplicationPrivate::notify_helper (this=0x561f2a554ae0, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #19 0x00007f88849e6ced in QApplication::notify (this=0x561f2a541420, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #20 0x00007f8886a481b9 in QCoreApplication::notifyInternal2 (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1118
    #21 0x00007f8886a48e29 in QCoreApplication::sendEvent (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1558
    #22 0x00007f8886a49d68 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x561f2a56fee0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1898
    #23 0x00007f8886a48c6c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1752
    #24 0x00007f88870377b1 in postEventSourceDispatch (s=0x561f2a5cce80) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
    #25 0x00007f888d50b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f888d50da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #27 0x00007f888d50e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #28 0x00007f88870369eb in QEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #29 0x00007f8886164858 in QPAEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #30 0x00007f888796a492 in QtInstance::ImplYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #31 0x00007f888796d511 in QtInstance::DoYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #32 0x00007f88924bd626 in ImplYield (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:385
    #33 0x00007f88924bcf3f in Application::Yield () at .../libreoffice/vcl/source/app/svapp.cxx:488
    #34 0x00007f88924bcd20 in Application::Execute () at .../libreoffice/vcl/source/app/svapp.cxx:360
    #35 0x00007f889b327b89 in desktop::Desktop::Main (this=0x7ffcd9ea1c00) at .../libreoffice/desktop/source/app/app.cxx:1679
    #36 0x00007f88924deaa6 in ImplSVMain () at .../libreoffice/vcl/source/app/svmain.cxx:230
    #37 0x00007f88924e0699 in SVMain () at .../libreoffice/vcl/source/app/svmain.cxx:248
    #38 0x00007f889b3a146a in soffice_main () at .../libreoffice/desktop/source/app/sofficemain.cxx:121
    #39 0x0000561ef2802a6d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #40 0x0000561ef2802a47 in main (argc=2, argv=0x7ffcd9ea1e08) at .../libreoffice/desktop/source/app/main.c:49

While QtAccessibleWidget::selectedItem already returns early
if the passed selection index is too large according to what
XAccessibleSelection::getSelectedAccessibleChildCount()
returns, this is not enough because Writer's SwAccessibleSelectionHelper
has an inconsistent/broken implementation:

SwAccessibleSelectionHelper::getSelectedAccessibleChildCount
returns the count of paragraphs that are (partially) selected
by the text cursor if no other objects are selected.
However, SwAccessibleSelectionHelper::getSelectedAccessibleChild
doesn't take these into account and therefore throws the
IndexOutOfBoundsException when called with any index.

Temporarily (in particular for backporting to release branches),
handle the exception in QtAccessibleWidget::selectedItem like
other a11y bridges do (see e.g. `selection_ref_selection`
for the gtk3 VCL plugin) to avoid the crash.

The underlying Writer issue described above will be fixed in a
separate commit (and for master only).

Change-Id: I874ad4a7a9faf79492967c943517d83df5f47e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180228
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
(cherry picked from commit 3eaa35e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180241
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 22, 2025
When using the qt6 vcl plugin with the Orca screen reader
running, selecting text in Writer resulted in a crash
due to an IndexOutOfBoundsException being thrown.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (rr) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f889b09ddef in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f889b049d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f889b0324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f889aca1a3d in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00007f889acb300a in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #6  0x00007f889aca15e9 in std::terminate() () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007f889acb3288 in __cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #8  0x00007f8862346900 in SwAccessibleSelectionHelper::throwIndexOutOfBoundsException (this=0x561f2f8d1910) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:72
    #9  0x00007f8862347df8 in SwAccessibleSelectionHelper::getSelectedAccessibleChild (this=0x561f2f8d1910, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:283
    #10 0x00007f8862298e6f in SwAccessibleDocument::getSelectedAccessibleChild (this=0x561f2f8d1800, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #11 0x00007f8862298eaf in non-virtual thunk to SwAccessibleDocument::getSelectedAccessibleChild(long) () at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #12 0x00007f88878c6200 in QtAccessibleWidget::selectedItem (this=0x7f887c014ac0, nSelectionIndex=0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:1861
    #13 0x00007f8885f08ba0 in AtSpiAdaptor::selectionInterface (this=0x561f2b8a7070, interface=0x7f887c014ac0, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:2596
    #14 0x00007f8885f03ce1 in AtSpiAdaptor::handleMessage (this=0x561f2b8a7070, message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1479
    #15 0x00007f888366d217 in QDBusConnectionPrivate::activateObject (this=0x7f887c00a390, node=..., msg=..., pathStartPos=27) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #16 0x00007f888366e1d0 in QDBusActivateObjectEvent::placeMetaCall (this=0x7f887c03aca0) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #17 0x00007f8886b09bb1 in QObject::event (this=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1431
    #18 0x00007f88849e2dd0 in QApplicationPrivate::notify_helper (this=0x561f2a554ae0, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #19 0x00007f88849e6ced in QApplication::notify (this=0x561f2a541420, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #20 0x00007f8886a481b9 in QCoreApplication::notifyInternal2 (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1118
    #21 0x00007f8886a48e29 in QCoreApplication::sendEvent (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1558
    #22 0x00007f8886a49d68 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x561f2a56fee0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1898
    #23 0x00007f8886a48c6c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1752
    #24 0x00007f88870377b1 in postEventSourceDispatch (s=0x561f2a5cce80) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
    #25 0x00007f888d50b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f888d50da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #27 0x00007f888d50e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #28 0x00007f88870369eb in QEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #29 0x00007f8886164858 in QPAEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #30 0x00007f888796a492 in QtInstance::ImplYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #31 0x00007f888796d511 in QtInstance::DoYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #32 0x00007f88924bd626 in ImplYield (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:385
    #33 0x00007f88924bcf3f in Application::Yield () at .../libreoffice/vcl/source/app/svapp.cxx:488
    #34 0x00007f88924bcd20 in Application::Execute () at .../libreoffice/vcl/source/app/svapp.cxx:360
    #35 0x00007f889b327b89 in desktop::Desktop::Main (this=0x7ffcd9ea1c00) at .../libreoffice/desktop/source/app/app.cxx:1679
    #36 0x00007f88924deaa6 in ImplSVMain () at .../libreoffice/vcl/source/app/svmain.cxx:230
    #37 0x00007f88924e0699 in SVMain () at .../libreoffice/vcl/source/app/svmain.cxx:248
    #38 0x00007f889b3a146a in soffice_main () at .../libreoffice/desktop/source/app/sofficemain.cxx:121
    #39 0x0000561ef2802a6d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #40 0x0000561ef2802a47 in main (argc=2, argv=0x7ffcd9ea1e08) at .../libreoffice/desktop/source/app/main.c:49

While QtAccessibleWidget::selectedItem already returns early
if the passed selection index is too large according to what
XAccessibleSelection::getSelectedAccessibleChildCount()
returns, this is not enough because Writer's SwAccessibleSelectionHelper
has an inconsistent/broken implementation:

SwAccessibleSelectionHelper::getSelectedAccessibleChildCount
returns the count of paragraphs that are (partially) selected
by the text cursor if no other objects are selected.
However, SwAccessibleSelectionHelper::getSelectedAccessibleChild
doesn't take these into account and therefore throws the
IndexOutOfBoundsException when called with any index.

Temporarily (in particular for backporting to release branches),
handle the exception in QtAccessibleWidget::selectedItem like
other a11y bridges do (see e.g. `selection_ref_selection`
for the gtk3 VCL plugin) to avoid the crash.

The underlying Writer issue described above will be fixed in a
separate commit (and for master only).

Change-Id: I874ad4a7a9faf79492967c943517d83df5f47e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180228
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
(cherry picked from commit 3eaa35e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180240
Reviewed-by: Xisco Fauli <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 23, 2025
When using the qt6 vcl plugin with the Orca screen reader
running, selecting text in Writer resulted in a crash
due to an IndexOutOfBoundsException being thrown.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (rr) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f889b09ddef in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f889b049d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f889b0324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f889aca1a3d in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00007f889acb300a in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #6  0x00007f889aca15e9 in std::terminate() () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007f889acb3288 in __cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #8  0x00007f8862346900 in SwAccessibleSelectionHelper::throwIndexOutOfBoundsException (this=0x561f2f8d1910) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:72
    #9  0x00007f8862347df8 in SwAccessibleSelectionHelper::getSelectedAccessibleChild (this=0x561f2f8d1910, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:283
    #10 0x00007f8862298e6f in SwAccessibleDocument::getSelectedAccessibleChild (this=0x561f2f8d1800, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #11 0x00007f8862298eaf in non-virtual thunk to SwAccessibleDocument::getSelectedAccessibleChild(long) () at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #12 0x00007f88878c6200 in QtAccessibleWidget::selectedItem (this=0x7f887c014ac0, nSelectionIndex=0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:1861
    #13 0x00007f8885f08ba0 in AtSpiAdaptor::selectionInterface (this=0x561f2b8a7070, interface=0x7f887c014ac0, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:2596
    #14 0x00007f8885f03ce1 in AtSpiAdaptor::handleMessage (this=0x561f2b8a7070, message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1479
    #15 0x00007f888366d217 in QDBusConnectionPrivate::activateObject (this=0x7f887c00a390, node=..., msg=..., pathStartPos=27) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #16 0x00007f888366e1d0 in QDBusActivateObjectEvent::placeMetaCall (this=0x7f887c03aca0) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #17 0x00007f8886b09bb1 in QObject::event (this=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1431
    #18 0x00007f88849e2dd0 in QApplicationPrivate::notify_helper (this=0x561f2a554ae0, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #19 0x00007f88849e6ced in QApplication::notify (this=0x561f2a541420, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #20 0x00007f8886a481b9 in QCoreApplication::notifyInternal2 (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1118
    #21 0x00007f8886a48e29 in QCoreApplication::sendEvent (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1558
    #22 0x00007f8886a49d68 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x561f2a56fee0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1898
    #23 0x00007f8886a48c6c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1752
    #24 0x00007f88870377b1 in postEventSourceDispatch (s=0x561f2a5cce80) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
    #25 0x00007f888d50b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f888d50da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #27 0x00007f888d50e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #28 0x00007f88870369eb in QEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #29 0x00007f8886164858 in QPAEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #30 0x00007f888796a492 in QtInstance::ImplYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #31 0x00007f888796d511 in QtInstance::DoYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #32 0x00007f88924bd626 in ImplYield (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:385
    #33 0x00007f88924bcf3f in Application::Yield () at .../libreoffice/vcl/source/app/svapp.cxx:488
    #34 0x00007f88924bcd20 in Application::Execute () at .../libreoffice/vcl/source/app/svapp.cxx:360
    #35 0x00007f889b327b89 in desktop::Desktop::Main (this=0x7ffcd9ea1c00) at .../libreoffice/desktop/source/app/app.cxx:1679
    #36 0x00007f88924deaa6 in ImplSVMain () at .../libreoffice/vcl/source/app/svmain.cxx:230
    #37 0x00007f88924e0699 in SVMain () at .../libreoffice/vcl/source/app/svmain.cxx:248
    #38 0x00007f889b3a146a in soffice_main () at .../libreoffice/desktop/source/app/sofficemain.cxx:121
    #39 0x0000561ef2802a6d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #40 0x0000561ef2802a47 in main (argc=2, argv=0x7ffcd9ea1e08) at .../libreoffice/desktop/source/app/main.c:49

While QtAccessibleWidget::selectedItem already returns early
if the passed selection index is too large according to what
XAccessibleSelection::getSelectedAccessibleChildCount()
returns, this is not enough because Writer's SwAccessibleSelectionHelper
has an inconsistent/broken implementation:

SwAccessibleSelectionHelper::getSelectedAccessibleChildCount
returns the count of paragraphs that are (partially) selected
by the text cursor if no other objects are selected.
However, SwAccessibleSelectionHelper::getSelectedAccessibleChild
doesn't take these into account and therefore throws the
IndexOutOfBoundsException when called with any index.

Temporarily (in particular for backporting to release branches),
handle the exception in QtAccessibleWidget::selectedItem like
other a11y bridges do (see e.g. `selection_ref_selection`
for the gtk3 VCL plugin) to avoid the crash.

The underlying Writer issue described above will be fixed in a
separate commit (and for master only).

Change-Id: I874ad4a7a9faf79492967c943517d83df5f47e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180228
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
(cherry picked from commit 3eaa35e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180240
Reviewed-by: Xisco Fauli <[email protected]>
(cherry picked from commit ff11ab3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180584
Tested-by: Christian Lohmaier <[email protected]>
Reviewed-by: Christian Lohmaier <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 24, 2025
TableControl::commitCellEventIfAccessibleAlive sends an event
on the currently selected/active cell. So only call it in
SVTXGridControl::ProcessWindowEvent when there is one.

Use TableControl::GetCurrentRow and TableControl::GetCurrentColumn
to check that, which return a special value (of -2) for the case there
is no active cell.

For TableControl::GetCurrentRow:

        /** retrieves the current row

            The current row is the one which contains the active cell.

            @return
                the row index of the active cell, or ->ROW_INVALID
                if there is no active cell, e.g. because the table does
                not contain any rows or columns.
        */
        sal_Int32 GetCurrentRow() const override;

The previous check whether the table has any rows was insufficient
and resulted in an invalid attempt to access vector elements at
negative indices.

For the tdf#164783 scenario:

    /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508:
    In function:
        reference
        std::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>>::operator[](size_type)
        [_Tp = rtl::Reference<accessibility::AccessibleGridControlTableCell>,
        _Allocator =
        std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>]

    Error: attempt to subscript container with out-of-bounds index -6, but
    container only holds 60 elements.

    Objects involved in the operation:
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }
    /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508:
    In function:
        reference
        std::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>>::operator[](size_type)
        [_Tp = rtl::Reference<accessibility::AccessibleGridControlTableCell>,
        _Allocator =
        std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>]

    Error: attempt to subscript container with out-of-bounds index -6, but
    container only holds 60 elements.

    Objects involved in the operation:
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at .../libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at .../libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at .../libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at .../libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3fda0) [0x7f7544649da0]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 std::__throw_bad_exception() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #9 std::__debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>>::operator[](unsigned long) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508
    #10 accessibility::AccessibleGridControlTable::getAccessibleChild(long) at .../libreoffice/vcl/source/accessibility/AccessibleGridControlTable.cxx:66
    #11 accessibility::AccessibleGridControlTable::getAccessibleCellAt(int, int) at .../libreoffice/vcl/source/accessibility/AccessibleGridControlTable.cxx:191
    #12 accessibility::AccessibleGridControl::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/vcl/source/accessibility/AccessibleGridControl.cxx:272
    #13 accessibility::AccessibleGridControlAccess::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/vcl/inc/accessibility/AccessibleGridControl.hxx:197
    #14 svt::table::TableControl_Impl::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/toolkit/source/controls/table/tablecontrol_impl.cxx:2304
    #15 svt::table::TableControl::commitCellEventIfAccessibleAlive(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/toolkit/source/controls/table/tablecontrol.cxx:470
    #16 SVTXGridControl::ProcessWindowEvent(VclWindowEvent const&) at .../libreoffice/toolkit/source/controls/svtxgridcontrol.cxx:823
    #17 VCLXWindow::WindowEventListener(VclWindowEvent&) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:390
    #18 VCLXWindow::LinkStubWindowEventListener(void*, VclWindowEvent&) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:383
    #19 Link<VclWindowEvent&, void>::Call(VclWindowEvent&) const at .../libreoffice/include/tools/link.hxx:101
    #20 vcl::Window::CallEventListeners(VclEventId, void*) at .../libreoffice/vcl/source/window/event.cxx:262
    #21 Control::CallEventListeners(VclEventId, void*) at .../libreoffice/vcl/source/control/ctrl.cxx:298
    #22 Control::ImplCallEventListenersAndHandler(VclEventId, std::function<void ()> const&) at .../libreoffice/vcl/source/control/ctrl.cxx:305
    #23 Control::EventNotify(NotifyEvent&) at .../libreoffice/vcl/source/control/ctrl.cxx:247
    #24 vcl::Window::CompatNotify(NotifyEvent&) at .../libreoffice/vcl/source/window/window.cxx:3943
    #25 vcl::Window::LoseFocus() at .../libreoffice/vcl/source/window/window.cxx:1861
    #26 svt::table::TableControl::LoseFocus() at .../libreoffice/toolkit/source/controls/table/tablecontrol.cxx:94
    #27 vcl::Window::CompatLoseFocus() at .../libreoffice/vcl/source/window/window.cxx:3912
    #28 vcl::Window::ImplAsyncFocusHdl(void*) at .../libreoffice/vcl/source/window/winproc.cxx:2127
    #29 vcl::Window::LinkStubImplAsyncFocusHdl(void*, void*) at .../libreoffice/vcl/source/window/winproc.cxx:2033
    #30 Link<void*, void>::Call(void*) const at .../libreoffice/include/tools/link.hxx:101
    #31 ImplHandleUserEvent(ImplSVEvent*) at .../libreoffice/vcl/source/window/winproc.cxx:2288
    #32 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at .../libreoffice/vcl/source/window/winproc.cxx:2849
    #33 SalFrame::CallCallback(SalEvent, void const*) const at .../libreoffice/vcl/inc/salframe.hxx:311
    #34 SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:67
    #35 SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const at .../libreoffice/vcl/source/app/salusereventlist.cxx:119
    #36 SalUserEventList::DispatchUserEvents(bool) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120
    #37 SalGenericDisplay::DispatchInternalEvent(bool) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #38 call_userEventFn(void*) at .../libreoffice/vcl/unx/gtk3/gtkdata.cxx:827
    #39 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5a81f) [0x7f7536f0b81f]
    #40 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5ca57) [0x7f7536f0da57]
    #41 g_main_loop_run in /lib/x86_64-linux-gnu/libglib-2.0.so.0
    ...

Change-Id: Iafed90e6985cf2c05d65be5f74334f58b369d945
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180661
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 24, 2025
TableControl::commitCellEventIfAccessibleAlive sends an event
on the currently selected/active cell. So only call it in
SVTXGridControl::ProcessWindowEvent when there is one.

Use TableControl::GetCurrentRow and TableControl::GetCurrentColumn
to check that, which return a special value (of -2) for the case there
is no active cell.

For TableControl::GetCurrentRow:

        /** retrieves the current row

            The current row is the one which contains the active cell.

            @return
                the row index of the active cell, or ->ROW_INVALID
                if there is no active cell, e.g. because the table does
                not contain any rows or columns.
        */
        sal_Int32 GetCurrentRow() const override;

The previous check whether the table has any rows was insufficient
and resulted in an invalid attempt to access vector elements at
negative indices.

For the tdf#164783 scenario:

    /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508:
    In function:
        reference
        std::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>>::operator[](size_type)
        [_Tp = rtl::Reference<accessibility::AccessibleGridControlTableCell>,
        _Allocator =
        std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>]

    Error: attempt to subscript container with out-of-bounds index -6, but
    container only holds 60 elements.

    Objects involved in the operation:
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }
    /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508:
    In function:
        reference
        std::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>>::operator[](size_type)
        [_Tp = rtl::Reference<accessibility::AccessibleGridControlTableCell>,
        _Allocator =
        std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>]

    Error: attempt to subscript container with out-of-bounds index -6, but
    container only holds 60 elements.

    Objects involved in the operation:
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at .../libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at .../libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at .../libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at .../libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3fda0) [0x7f7544649da0]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 std::__throw_bad_exception() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #9 std::__debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>>::operator[](unsigned long) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508
    #10 accessibility::AccessibleGridControlTable::getAccessibleChild(long) at .../libreoffice/vcl/source/accessibility/AccessibleGridControlTable.cxx:66
    #11 accessibility::AccessibleGridControlTable::getAccessibleCellAt(int, int) at .../libreoffice/vcl/source/accessibility/AccessibleGridControlTable.cxx:191
    #12 accessibility::AccessibleGridControl::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/vcl/source/accessibility/AccessibleGridControl.cxx:272
    #13 accessibility::AccessibleGridControlAccess::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/vcl/inc/accessibility/AccessibleGridControl.hxx:197
    #14 svt::table::TableControl_Impl::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/toolkit/source/controls/table/tablecontrol_impl.cxx:2304
    #15 svt::table::TableControl::commitCellEventIfAccessibleAlive(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/toolkit/source/controls/table/tablecontrol.cxx:470
    #16 SVTXGridControl::ProcessWindowEvent(VclWindowEvent const&) at .../libreoffice/toolkit/source/controls/svtxgridcontrol.cxx:823
    #17 VCLXWindow::WindowEventListener(VclWindowEvent&) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:390
    #18 VCLXWindow::LinkStubWindowEventListener(void*, VclWindowEvent&) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:383
    #19 Link<VclWindowEvent&, void>::Call(VclWindowEvent&) const at .../libreoffice/include/tools/link.hxx:101
    #20 vcl::Window::CallEventListeners(VclEventId, void*) at .../libreoffice/vcl/source/window/event.cxx:262
    #21 Control::CallEventListeners(VclEventId, void*) at .../libreoffice/vcl/source/control/ctrl.cxx:298
    #22 Control::ImplCallEventListenersAndHandler(VclEventId, std::function<void ()> const&) at .../libreoffice/vcl/source/control/ctrl.cxx:305
    #23 Control::EventNotify(NotifyEvent&) at .../libreoffice/vcl/source/control/ctrl.cxx:247
    #24 vcl::Window::CompatNotify(NotifyEvent&) at .../libreoffice/vcl/source/window/window.cxx:3943
    #25 vcl::Window::LoseFocus() at .../libreoffice/vcl/source/window/window.cxx:1861
    #26 svt::table::TableControl::LoseFocus() at .../libreoffice/toolkit/source/controls/table/tablecontrol.cxx:94
    #27 vcl::Window::CompatLoseFocus() at .../libreoffice/vcl/source/window/window.cxx:3912
    #28 vcl::Window::ImplAsyncFocusHdl(void*) at .../libreoffice/vcl/source/window/winproc.cxx:2127
    #29 vcl::Window::LinkStubImplAsyncFocusHdl(void*, void*) at .../libreoffice/vcl/source/window/winproc.cxx:2033
    #30 Link<void*, void>::Call(void*) const at .../libreoffice/include/tools/link.hxx:101
    #31 ImplHandleUserEvent(ImplSVEvent*) at .../libreoffice/vcl/source/window/winproc.cxx:2288
    #32 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at .../libreoffice/vcl/source/window/winproc.cxx:2849
    #33 SalFrame::CallCallback(SalEvent, void const*) const at .../libreoffice/vcl/inc/salframe.hxx:311
    #34 SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:67
    #35 SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const at .../libreoffice/vcl/source/app/salusereventlist.cxx:119
    #36 SalUserEventList::DispatchUserEvents(bool) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120
    #37 SalGenericDisplay::DispatchInternalEvent(bool) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #38 call_userEventFn(void*) at .../libreoffice/vcl/unx/gtk3/gtkdata.cxx:827
    #39 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5a81f) [0x7f7536f0b81f]
    #40 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5ca57) [0x7f7536f0da57]
    #41 g_main_loop_run in /lib/x86_64-linux-gnu/libglib-2.0.so.0
    ...

Change-Id: Iafed90e6985cf2c05d65be5f74334f58b369d945
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180661
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
(cherry picked from commit 57906dd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180680
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 24, 2025
TableControl::commitCellEventIfAccessibleAlive sends an event
on the currently selected/active cell. So only call it in
SVTXGridControl::ProcessWindowEvent when there is one.

Use TableControl::GetCurrentRow and TableControl::GetCurrentColumn
to check that, which return a special value (of -2) for the case there
is no active cell.

For TableControl::GetCurrentRow:

        /** retrieves the current row

            The current row is the one which contains the active cell.

            @return
                the row index of the active cell, or ->ROW_INVALID
                if there is no active cell, e.g. because the table does
                not contain any rows or columns.
        */
        sal_Int32 GetCurrentRow() const override;

The previous check whether the table has any rows was insufficient
and resulted in an invalid attempt to access vector elements at
negative indices.

For the tdf#164783 scenario:

    /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508:
    In function:
        reference
        std::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>>::operator[](size_type)
        [_Tp = rtl::Reference<accessibility::AccessibleGridControlTableCell>,
        _Allocator =
        std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>]

    Error: attempt to subscript container with out-of-bounds index -6, but
    container only holds 60 elements.

    Objects involved in the operation:
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }
    /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508:
    In function:
        reference
        std::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>>::operator[](size_type)
        [_Tp = rtl::Reference<accessibility::AccessibleGridControlTableCell>,
        _Allocator =
        std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>]

    Error: attempt to subscript container with out-of-bounds index -6, but
    container only holds 60 elements.

    Objects involved in the operation:
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }
        sequence "this" @ 0x5638c74e2350 {
          type = std::debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell> > >;
        }

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at .../libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at .../libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at .../libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at .../libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3fda0) [0x7f7544649da0]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 std::__throw_bad_exception() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #9 std::__debug::vector<rtl::Reference<accessibility::AccessibleGridControlTableCell>, std::allocator<rtl::Reference<accessibility::AccessibleGridControlTableCell>>>::operator[](unsigned long) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/debug/vector:508
    #10 accessibility::AccessibleGridControlTable::getAccessibleChild(long) at .../libreoffice/vcl/source/accessibility/AccessibleGridControlTable.cxx:66
    #11 accessibility::AccessibleGridControlTable::getAccessibleCellAt(int, int) at .../libreoffice/vcl/source/accessibility/AccessibleGridControlTable.cxx:191
    #12 accessibility::AccessibleGridControl::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/vcl/source/accessibility/AccessibleGridControl.cxx:272
    #13 accessibility::AccessibleGridControlAccess::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/vcl/inc/accessibility/AccessibleGridControl.hxx:197
    #14 svt::table::TableControl_Impl::commitCellEvent(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/toolkit/source/controls/table/tablecontrol_impl.cxx:2304
    #15 svt::table::TableControl::commitCellEventIfAccessibleAlive(short, com::sun::star::uno::Any const&, com::sun::star::uno::Any const&) at .../libreoffice/toolkit/source/controls/table/tablecontrol.cxx:470
    #16 SVTXGridControl::ProcessWindowEvent(VclWindowEvent const&) at .../libreoffice/toolkit/source/controls/svtxgridcontrol.cxx:823
    #17 VCLXWindow::WindowEventListener(VclWindowEvent&) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:390
    #18 VCLXWindow::LinkStubWindowEventListener(void*, VclWindowEvent&) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:383
    #19 Link<VclWindowEvent&, void>::Call(VclWindowEvent&) const at .../libreoffice/include/tools/link.hxx:101
    #20 vcl::Window::CallEventListeners(VclEventId, void*) at .../libreoffice/vcl/source/window/event.cxx:262
    #21 Control::CallEventListeners(VclEventId, void*) at .../libreoffice/vcl/source/control/ctrl.cxx:298
    #22 Control::ImplCallEventListenersAndHandler(VclEventId, std::function<void ()> const&) at .../libreoffice/vcl/source/control/ctrl.cxx:305
    #23 Control::EventNotify(NotifyEvent&) at .../libreoffice/vcl/source/control/ctrl.cxx:247
    #24 vcl::Window::CompatNotify(NotifyEvent&) at .../libreoffice/vcl/source/window/window.cxx:3943
    #25 vcl::Window::LoseFocus() at .../libreoffice/vcl/source/window/window.cxx:1861
    #26 svt::table::TableControl::LoseFocus() at .../libreoffice/toolkit/source/controls/table/tablecontrol.cxx:94
    #27 vcl::Window::CompatLoseFocus() at .../libreoffice/vcl/source/window/window.cxx:3912
    #28 vcl::Window::ImplAsyncFocusHdl(void*) at .../libreoffice/vcl/source/window/winproc.cxx:2127
    #29 vcl::Window::LinkStubImplAsyncFocusHdl(void*, void*) at .../libreoffice/vcl/source/window/winproc.cxx:2033
    #30 Link<void*, void>::Call(void*) const at .../libreoffice/include/tools/link.hxx:101
    #31 ImplHandleUserEvent(ImplSVEvent*) at .../libreoffice/vcl/source/window/winproc.cxx:2288
    #32 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at .../libreoffice/vcl/source/window/winproc.cxx:2849
    #33 SalFrame::CallCallback(SalEvent, void const*) const at .../libreoffice/vcl/inc/salframe.hxx:311
    #34 SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:67
    #35 SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const at .../libreoffice/vcl/source/app/salusereventlist.cxx:119
    #36 SalUserEventList::DispatchUserEvents(bool) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120
    #37 SalGenericDisplay::DispatchInternalEvent(bool) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #38 call_userEventFn(void*) at .../libreoffice/vcl/unx/gtk3/gtkdata.cxx:827
    #39 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5a81f) [0x7f7536f0b81f]
    #40 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5ca57) [0x7f7536f0da57]
    #41 g_main_loop_run in /lib/x86_64-linux-gnu/libglib-2.0.so.0
    ...

Change-Id: Iafed90e6985cf2c05d65be5f74334f58b369d945
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180661
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
(cherry picked from commit 57906dd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180681
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 30, 2025
This fixes various asserts triggered when opening the sample doc
attachment 198264 from tdf#164460 with the qt6 VCL plugin
and using a current qtbase git dev build, for example:

    ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread QThread(0x7fffbc000f50). Receiver 'QWidgetWindow(0x555556dd9f10, name = "QtMainWindowClassWindow")' was created in thread QThread(0x555555564ee0, name = "Qt mainThread")", file /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 530

    Thread 24 "DocumentEventNo" received signal SIGABRT, Aborted.
    [Switching to Thread 0x7fffc4f4f6c0 (LWP 625101)]
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007ffff789de2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007ffff7849d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff78324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007fffe3302efd in qAbort () at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:46
    #5  0x00007fffe3349788 in qt_message_fatal<QString&> (context=..., message=...) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2062
    #6  0x00007fffe334298d in qt_message (msgType=QtFatalMsg, context=..., msg=0x7fffe3a8edf3 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fffc4f478f0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:342
    #7  0x00007fffe3344cdd in QMessageLogger::fatal (this=0x7fffc4f47a90, msg=0x7fffe3a8edf3 "ASSERT failure in %s: \"%s\", file %s, line %d") at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:831
    #8  0x00007fffe3302fb3 in qt_assert_x
        (where=0x7fffe3a98873 "QCoreApplication::sendEvent", what=0x7fffbc000c00 "Cannot send events to objects owned by a different thread. Current thread QThread(0x7fffbc000f50). Receiver 'QWidgetWindow(0x555556dd9f10, name = \"QtMainWindowClassWindow\")' was created in thread QThr"..., file=0x7fffe3a9864f "/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp", line=530)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:115
    #9  0x00007fffe3447d56 in QCoreApplicationPrivate::checkReceiverThread (receiver=0x555556dd9f10) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:526
    #10 0x00007fffe13e3f91 in QApplication::notify (this=0x555555564e20, receiver=0x555556dd9f10, e=0x7fffc4f486a0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2590
    #11 0x00007fffe3449dc9 in QCoreApplication::notifyInternal2 (receiver=0x555556dd9f10, event=0x7fffc4f486a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #12 0x00007fffe344aa39 in QCoreApplication::sendEvent (receiver=0x555556dd9f10, event=0x7fffc4f486a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1552
    #13 0x00007fffe235f1ff in QWindowPrivate::setCursor (this=0x5555571f48a0, newCursor=0x7fffc4f48770) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:3269
    #14 0x00007fffe235f0ce in QWindow::setCursor (this=0x555556dd9f10, cursor=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:3227
    #15 0x00007fffe1492921 in applyCursor (w=0x555556e5d360, c=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:5020
    #16 0x00007fffe148e6e4 in qt_qpa_set_cursor (w=0x55555707ea30, force=false) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:5058
    #17 0x00007fffe14927cc in QWidgetPrivate::setCursor_sys (this=0x555556e37f10, cursor=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:4995
    #18 0x00007fffe149274e in QWidget::setCursor (this=0x55555707ea30, cursor=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:4985
    #19 0x00007fffe43493b8 in QtFrame::SetPointer (this=0x555556dc14c0, ePointerStyle=PointerStyle::Wait) at vcl/qt6/../qt5/QtFrame.cxx:794
    #20 0x00007fffee3db06e in vcl::Window::EnterWait (this=0x555556df3620) at /home/michi/development/git/libreoffice/vcl/source/window/mouse.cxx:614
    #21 0x00007fffeebd9b16 in SalInstanceWidget::set_busy_cursor (this=0x5555575c9520, bBusy=true) at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:625
    #22 0x00007fffa505266a in weld::WaitObject::WaitObject (this=0x7fffc4f48a48, pWindow=0x5555575c9560) at include/vcl/weld.hxx:611
    #23 0x00007fffa504c0b1 in dbaui::OApplicationController::ensureConnection (this=0x555556e115f0, _pErrorInfo=0x7fffc4f48b48) at /home/michi/development/git/libreoffice/dbaccess/source/ui/app/AppControllerDnD.cxx:310
    #24 0x00007fffa505f75a in dbaui::OApplicationController::connect (this=0x555556e115f0) at /home/michi/development/git/libreoffice/dbaccess/source/ui/app/AppControllerGen.cxx:316
    #25 0x00007fffe0b370ed in gcc3::callVirtualMethod (pThis=0x555556e11968, nVtableIndex=8, pRegisterReturn=0x0, pReturnTypeRef=0x555555604370, bSimpleReturn=true, pStack=0x7fffc4f48c70, nStack=0, pGPR=0x7fffc4f48f40, pFPR=0x7fffc4f48f00)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:87
    #26 0x00007fffe0b35e5b in cpp_call (pThis=0x7fffbc2af2e0, aVtableSlot=..., pReturnTypeRef=0x555555604370, nParams=0, pParams=0x0, pUnoReturn=0x0, pUnoArgs=0x7fffc4f490c0, ppUnoExc=0x7fffc4f49370)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:229
    #27 0x00007fffe0b35626 in unoInterfaceProxyDispatch (pUnoI=0x7fffbc2af2e0, pMemberDescr=0x7fffbc2b0bd0, pReturn=0x0, pArgs=0x7fffc4f490c0, ppException=0x7fffc4f49370)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:409
    #28 0x00007fffb6fe565a in stoc_corefl::(anonymous namespace)::IdlInterfaceMethodImpl::invoke (this=0x7fffbc2b33d0, rObj=uno::Any("com.sun.star.frame.XController": ...), rArgs=empty uno::Sequence)
        at /home/michi/development/git/libreoffice/stoc/source/corereflection/criface.cxx:591
    #29 0x00007fffb6fe5e74 in non-virtual thunk to stoc_corefl::(anonymous namespace)::IdlInterfaceMethodImpl::invoke(com::sun::star::uno::Any const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) ()
        at /home/michi/development/git/libreoffice/instdir/program/libreflectionlo.so
    #30 0x00007ffff4618bde in SbUnoObject::Notify (this=0x7fffbc29fea0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:2249
    #31 0x00007ffff3151a4c in SfxBroadcaster::Broadcast (this=0x7fffbc2b5480, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #32 0x00007ffff47c7ad4 in SbxVariable::Broadcast (this=0x7fffbc2b5990, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:154
    #33 0x00007ffff47c04fd in SbxValue::SbxValue (this=0x7fffbc2808c0, vtt=0x7ffff47eb6d0 <VTT for SbxMethod+16>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:68
    #34 0x00007ffff47c6674 in SbxVariable::SbxVariable (this=0x7fffbc2808c0, vtt=0x7ffff47eb6c8 <VTT for SbxMethod+8>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:48
    #35 0x00007ffff47b6f4a in SbxMethod::SbxMethod (this=0x7fffbc2808c0, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:842
    #36 0x00007ffff477782a in SbiRuntime::FindElement (this=0x7fffbc1bfb00, pObj=0x7fffbc29fea0, nOp1=75, nOp2=12, nNotFound=..., bLocal=false, bStatic=false) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:3701
    #37 0x00007ffff476adc2 in SbiRuntime::StepELEM (this=0x7fffbc1bfb00, nOp1=75, nOp2=12) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4187
    #38 0x00007ffff476fa77 in SbiRuntime::Step (this=0x7fffbc1bfb00) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:808
    #39 0x00007ffff46638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7fffc4f4a4c0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #40 0x00007ffff466262d in SbModule::Run (this=0x7fffbc093b00, pMeth=0x7fffbc16d040) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #41 0x00007ffff4661b41 in SbModule::Notify (this=0x7fffbc093b00, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #42 0x00007ffff3151a4c in SfxBroadcaster::Broadcast (this=0x7fffbc094fb0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #43 0x00007ffff466879b in SbMethod::Broadcast (this=0x7fffbc095060, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #44 0x00007ffff47c04fd in SbxValue::SbxValue (this=0x7fffbc1b9590, vtt=0x7ffff47eb6d0 <VTT for SbxMethod+16>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:68
    #45 0x00007ffff47c6674 in SbxVariable::SbxVariable (this=0x7fffbc1b9590, vtt=0x7ffff47eb6c8 <VTT for SbxMethod+8>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:48
    #46 0x00007ffff47b6f4a in SbxMethod::SbxMethod (this=0x7fffbc1b9590, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:842
    #47 0x00007ffff477782a in SbiRuntime::FindElement (this=0x7fffbc16d360, pObj=0x7fffbc093b00, nOp1=10, nOp2=0, nNotFound=..., bLocal=true, bStatic=false) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:3701
    #48 0x00007ffff4778e95 in SbiRuntime::StepFIND_Impl (this=0x7fffbc16d360, pObj=0x7fffbc093b00, nOp1=10, nOp2=0, nNotFound=..., bStatic=false) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4134
    #49 0x00007ffff476ac0d in SbiRuntime::StepFIND (this=0x7fffbc16d360, nOp1=10, nOp2=0) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4140
    #50 0x00007ffff476fa77 in SbiRuntime::Step (this=0x7fffbc16d360) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:808
    #51 0x00007ffff46638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7fffc4f4b3c0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #52 0x00007ffff466262d in SbModule::Run (this=0x7fffbc093b00, pMeth=0x7fffbc162760) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #53 0x00007ffff4661b41 in SbModule::Notify (this=0x7fffbc093b00, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #54 0x00007ffff3151a4c in SfxBroadcaster::Broadcast (this=0x7fffbc093f10, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #55 0x00007ffff466879b in SbMethod::Broadcast (this=0x7fffbc0938c0, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #56 0x00007ffff47c0ef3 in SbxValue::Get (this=0x7fffbc0938c0, rRes=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:290
    #57 0x00007ffff466848b in SbMethod::Call (this=0x7fffbc0938c0, pRet=0x7fffbc156ef0, pCaller=0x0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2071
    #58 0x00007fffdc9f4cfe in basprov::BasicScriptImpl::invoke (this=0x7fffbc012bd0, aParams=uno::Sequence of length 1 = {...}, aOutParamIndex=empty uno::Sequence, aOutParam=empty uno::Sequence)
        at /home/michi/development/git/libreoffice/scripting/source/basprov/basscript.cxx:262
    #59 0x00007fffdc9f54ac in non-virtual thunk to basprov::BasicScriptImpl::invoke(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) () at /home/michi/development/git/libreoffice/instdir/program/../program/libbasprovlo.so
    #60 0x00007fffdffeedc7 in scripting_protocolhandler::ScriptProtocolHandler::dispatchWithNotification (this=0x7fffbc002330, aURL=..., lArgs=uno::Sequence of length 1 = {...}, xListener=empty uno::Reference)
        at /home/michi/development/git/libreoffice/scripting/source/protocolhandler/scripthandler.cxx:213
    #61 0x00007fffdfff02ef in scripting_protocolhandler::ScriptProtocolHandler::dispatch (this=0x7fffbc002330, aURL=..., lArgs=uno::Sequence of length 1 = {...})
        at /home/michi/development/git/libreoffice/scripting/source/protocolhandler/scripthandler.cxx:286
    #62 0x00007fffc6f7d166 in dbaccess::(anonymous namespace)::lcl_dispatchScriptURL_throw
        (xWeakDocument=..., xURLTransformer=uno::Reference to ((anonymous namespace)::URLTransformer *) 0x555557223d28, _rScriptURL="vnd.sun.star.script:Standard.Backup.DatabaseStart?language=Basic&location=document", _rTrigger=...)
        at /home/michi/development/git/libreoffice/dbaccess/source/core/dataaccess/documenteventexecutor.cxx:100
    #63 0x00007fffc6f7cbe6 in dbaccess::DocumentEventExecutor::documentEventOccured (this=0x55555721f030, Event=...) at /home/michi/development/git/libreoffice/dbaccess/source/core/dataaccess/documenteventexecutor.cxx:169
    #64 0x00007fffc6f8dfb7 in comphelper::OInterfaceContainerHelper3<com::sun::star::document::XDocumentEventListener>::NotifySingleListener<com::sun::star::document::DocumentEvent>::operator()
        (this=0x7fffc4f4d220, listener=uno::Reference to (dbaccess::DocumentEventExecutor *) 0x55555721f058) at include/comphelper/interfacecontainer3.hxx:249
    #65 0x00007fffc6f8dd45 in comphelper::OInterfaceContainerHelper3<com::sun::star::document::XDocumentEventListener>::forEach<comphelper::OInterfaceContainerHelper3<com::sun::star::document::XDocumentEventListener>::NotifySingleListener<com::sun::star::document::DocumentEvent> > (this=0x55555721f368, func=...) at include/comphelper/interfacecontainer3.hxx:275
    #66 0x00007fffc6f7fd33 in comphelper::OInterfaceContainerHelper3<com::sun::star::document::XDocumentEventListener>::notifyEach<com::sun::star::document::DocumentEvent>
        (this=0x55555721f368, NotificationMethod=&virtual table offset 32, Event=...) at include/comphelper/interfacecontainer3.hxx:290
    #67 0x00007fffc6f7f007 in dbaccess::DocumentEventNotifier_Impl::impl_notifyEvent_nothrow (this=0x55555721f320, _rEvent=...) at /home/michi/development/git/libreoffice/dbaccess/source/core/dataaccess/documenteventnotifier.cxx:197
    #68 0x00007fffc6f7f3b9 in dbaccess::DocumentEventNotifier_Impl::processEvent (this=0x55555721f320, _rEvent=...) at /home/michi/development/git/libreoffice/dbaccess/source/core/dataaccess/documenteventnotifier.cxx:230
    #69 0x00007ffff6119f47 in comphelper::AsyncEventNotifierBase::execute (this=0x5555575b4de0) at /home/michi/development/git/libreoffice/comphelper/source/misc/asyncnotification.cxx:139
    #70 0x00007ffff611b074 in comphelper::AsyncEventNotifierAutoJoin::run (this=0x5555575b4de0) at /home/michi/development/git/libreoffice/comphelper/source/misc/asyncnotification.cxx:246
    #71 0x00007ffff612743e in threadFunc (param=0x5555575b4df0) at include/osl/thread.hxx:189
    #72 0x00007ffff7fa2ccb in osl_thread_start_Impl (pData=0x5555575a22b0) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:237
    #73 0x00007ffff789c083 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
    #74 0x00007ffff791a7b8 in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Change-Id: I0ee7aa62893da92b886acfd3d47be0bdb10d6007
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180937
Reviewed-by: Michael Weghorn <[email protected]>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Jan 30, 2025
This fixes this assert triggered when opening the sample doc
attachment 198264 from tdf#164460 with the qt6 VCL plugin
and running the macro, using a current qtbase git dev build:

    ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread QThread(0x7fffbc000f50). Receiver 'QWidget(0x555558de1c00)' was created in thread QThread(0x555555564ee0, name = "Qt mainThread")", file /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 530

    Thread 24 "DocumentEventNo" received signal SIGABRT, Aborted.
    [Switching to Thread 0x7fffc4f4f6c0 (LWP 626865)]
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007ffff789de2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007ffff7849d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff78324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007fffe3302efd in qAbort () at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:46
    #5  0x00007fffe3349788 in qt_message_fatal<QString&> (context=..., message=...) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2062
    #6  0x00007fffe334298d in qt_message (msgType=QtFatalMsg, context=..., msg=0x7fffe3a8edf3 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fffc4f41650)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:342
    #7  0x00007fffe3344cdd in QMessageLogger::fatal (this=0x7fffc4f417f0, msg=0x7fffe3a8edf3 "ASSERT failure in %s: \"%s\", file %s, line %d") at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:831
    #8  0x00007fffe3302fb3 in qt_assert_x
        (where=0x7fffe3a98873 "QCoreApplication::sendEvent", what=0x7fff60309060 "Cannot send events to objects owned by a different thread. Current thread QThread(0x7fffbc000f50). Receiver 'QWidget(0x555558de1c00)' was created in thread QThread(0x555555564ee0, name = \"Qt mainThrea"..., file=0x7fffe3a9864f "/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp", line=530)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:115
    #9  0x00007fffe3447d56 in QCoreApplicationPrivate::checkReceiverThread (receiver=0x555558de1c00) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:526
    #10 0x00007fffe13e3f91 in QApplication::notify (this=0x555555564e20, receiver=0x555558de1c00, e=0x7fffc4f42478) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2590
    #11 0x00007fffe3449dc9 in QCoreApplication::notifyInternal2 (receiver=0x555558de1c00, event=0x7fffc4f42478) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #12 0x00007fffe344aa39 in QCoreApplication::sendEvent (receiver=0x555558de1c00, event=0x7fffc4f42478) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1552
    #13 0x00007fffe148741a in QWidget::~QWidget (this=0x555558de1c00) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1569
    #14 0x00007fffe1780ab3 in QMenu::~QMenu (this=0x555558de1c00) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qmenu.cpp:1798
    #15 0x00007fffe1780b7d in QMenu::~QMenu (this=0x555558de1c00) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qmenu.cpp:1782
    #16 0x00007fffe443bf08 in std::default_delete<QMenu>::operator() (this=0x555558de18d8, __ptr=0x555558de1c00) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #17 0x00007fffe443bd5f in std::unique_ptr<QMenu, std::default_delete<QMenu> >::~unique_ptr (this=0x555558de18d8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:399
    #18 0x00007fffe44379fc in QtMenu::~QtMenu (this=0x555558de1860) at vcl/inc/qt6/../qt5/QtMenu.hxx:40
    #19 0x00007fffe4437a59 in QtMenu::~QtMenu (this=0x555558de1860) at vcl/inc/qt6/../qt5/QtMenu.hxx:40
    #20 0x00007fffee3b8ce8 in std::default_delete<SalMenu>::operator() (this=0x7fff6030d320, __ptr=0x555558de1870) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #21 0x00007fffee3b8c28 in std::__uniq_ptr_impl<SalMenu, std::default_delete<SalMenu> >::reset (this=0x7fff6030d320, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:205
    #22 0x00007fffee3b1a2d in std::unique_ptr<SalMenu, std::default_delete<SalMenu> >::reset (this=0x7fff6030d320, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #23 0x00007fffee3a27b8 in Menu::dispose (this=0x7fff6030d210) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:225
    #24 0x00007fffee7122a3 in VclReferenceBase::disposeOnce (this=0x7fff6030d210) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #25 0x00007fffee283ddb in VclPtr<PopupMenu>::disposeAndClear (this=0x7fff60310ba8) at include/vcl/vclptr.hxx:207
    #26 0x00007fffeebdba5c in SalInstanceMenu::~SalInstanceMenu (this=0x7fff60310b80) at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:974
    #27 0x00007fffeebdbab9 in SalInstanceMenu::~SalInstanceMenu (this=0x7fff60310b80) at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:971
    #28 0x00007ffff275023b in std::default_delete<weld::Menu>::operator() (this=0x7fffc4f42960, __ptr=0x7fff60310b80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #29 0x00007ffff273552f in std::unique_ptr<weld::Menu, std::default_delete<weld::Menu> >::~unique_ptr (this=0x7fffc4f42960) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:399
    #30 0x00007ffff2a300fd in (anonymous namespace)::SelectionTypePopup::~SelectionTypePopup (this=0x7fffc4f42950) at /home/michi/development/git/libreoffice/svx/source/stbctrls/selctrl.cxx:48
    #31 0x00007ffff2a2fd68 in SvxSelectionModeControl::StateChangedAtStatusBarControl (this=0x7fff602fa6b0, eState=SfxItemState::DEFAULT, pState=0x7fff6025c330) at /home/michi/development/git/libreoffice/svx/source/stbctrls/selctrl.cxx:130
    #32 0x00007ffff419db7e in SfxStatusBarControl::statusChanged (this=0x7fff602fa6b0, rEvent=...) at /home/michi/development/git/libreoffice/sfx2/source/statbar/stbitem.cxx:263
    #33 0x00007ffff3c9f158 in SfxDispatchController_Impl::addStatusListener (this=0x7fff601c92c0, aListener=uno::Reference to (SvxSelectionModeControl *) 0x7fff602fa6c0, aURL=...)
        at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:841
    #34 0x00007ffff3c9ee04 in SfxOfficeDispatch::addStatusListener (this=0x7fff6030bd90, aListener=uno::Reference to (SvxSelectionModeControl *) 0x7fff602fa6c0, aURL=...)
        at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:283
    #35 0x00007ffff0aa6737 in svt::StatusbarController::bindListener (this=0x7fff602fa6b0) at /home/michi/development/git/libreoffice/svtools/source/uno/statusbarcontroller.cxx:462
    #36 0x00007ffff0aa60c9 in svt::StatusbarController::update (this=0x7fff602fa6b0) at /home/michi/development/git/libreoffice/svtools/source/uno/statusbarcontroller.cxx:169
    #37 0x00007ffff4f4242b in framework::(anonymous namespace)::lcl_UpdateController<std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > > >::operator() (this=0x7fffc4f43117, rElement={...})
        at /home/michi/development/git/libreoffice/framework/source/uielement/statusbarmanager.cxx:69
    #38 0x00007ffff4f3efaf in std::for_each<__gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > >, std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > >, std::bidirectional_iterator_tag>, framework::(anonymous namespace)::lcl_UpdateController<std::__debug::map<unsigned short, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController>, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, com::sun::star::uno::Reference<com::sun::star::frame::XStatusbarController> > > > > > (__first={...}, __last={...}, __f=...)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_algo.h:3786
    #39 0x00007ffff4f3e365 in framework::StatusBarManager::UpdateControllers (this=0x7fff602ccc10) at /home/michi/development/git/libreoffice/framework/source/uielement/statusbarmanager.cxx:269
    #40 0x00007ffff4f40c4b in framework::StatusBarManager::FillStatusBar (this=0x7fff602ccc10, rItemContainer=uno::Reference to (framework::ConstItemContainer *) 0x7fff6029b8c8)
        at /home/michi/development/git/libreoffice/framework/source/uielement/statusbarmanager.cxx:479
    #41 0x00007ffff4f4b7f8 in framework::StatusBarWrapper::initialize (this=0x7fff602d1320, aArguments=uno::Sequence of length 4 = {...}) at /home/michi/development/git/libreoffice/framework/source/uielement/statusbarwrapper.cxx:117
    #42 0x00007ffff4ff9ac4 in framework::MenuBarFactory::CreateUIElement
    [...]

Change-Id: I787bb74644dcf29ccbd6c7a59fe5ca9fc7a50061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180938
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 30, 2025
Fix crash with the backtrace below when opening sample doc
attachment 198795 from tdf#164885 with macros enabled
when using the qt6 VCL plugin.

sfx2::SfxNotebookBar::StateMethod (frame 80) calls
SystemWindow::SetNotebookBar (frame 79) which calls
ImplBorderWindow::SetNotebookBar (frame 78) which
first disposes and clears the existing
ImplBorderWindow::mpNotebookBar and then creates
a new one.

However, calling the NotebookBar ctor triggers
a recursive call to sfx2::SfxNotebookBar::StateMethod
and SystemWindow::SetNotebookBar again (see frame 4).

When that one calls SystemWindow::SetNotebookBar,
it skips the logic to set a new NoteBookbar, but
the following call to the getter
SystemWindow::GetNotebookBar returns null, because
the previous ImplBorderWindow::SetNotebookBar (in frame 78, s. above)
hasn't finished yet.

For now, prevent such recursion from happening by
returning early in sfx2::SfxNotebookBar::StateMethod
if the NoteBookBar is already in the process of
getting set up.

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007f3030de3eb5 in std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:193
    193           pointer    _M_ptr() const noexcept { return std::get<0>(_M_t); }
    (rr) bt
    #0  0x00007f3030de3eb5 in std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:193
    #1  0x00007f3030de3e95 in std::unique_ptr<WindowImpl, std::default_delete<WindowImpl> >::get (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:465
    #2  0x00007f3030e1c6e5 in std::unique_ptr<WindowImpl, std::default_delete<WindowImpl> >::operator bool (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:482
    #3  0x00007f30310a1c67 in vcl::Window::Show (this=0x0, bVisible=true, nFlags=ShowFlags::NONE) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:2193
    #4  0x00007f3036cabbf2 in sfx2::SfxNotebookBar::StateMethod (pSysWindow=0x561c07f14910, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=false)
        at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:524
    #5  0x00007f3036cab110 in sfx2::SfxNotebookBar::StateMethod (rBindings=..., rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=false) at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:422
    #6  0x00007f300b7bc406 in SwDocShell::GetState (this=0x561c07140db0, rSet=SfxItemSet of pool 0x561c07b742c0 with parent 0x0 and Which ranges: [(10338, 10338)])
        at /home/michi/development/git/libreoffice/sw/source/uibase/app/docsh.cxx:1117
    #7  0x00007f300b7bb7cd in SfxStubSwDocShellGetState (pShell=0x561c07140db0, rSet=SfxItemSet of pool 0x561c07b742c0 with parent 0x0 and Which ranges: [(10338, 10338)]) at workdir/SdiTarget/sw/sdi/swslots.hxx:1427
    #8  0x00007f3036822a3a in SfxShell::GetSlotState (this=0x561c07140db0, nSlotId=10338, pIF=0x561c0add4a90, pStateSet=0x0) at /home/michi/development/git/libreoffice/sfx2/source/control/shell.cxx:492
    #9  0x00007f30367d1278 in SfxDispatcher::QueryState (this=0x561c0b151ec0, nSlot=10338, rState=...) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:2030
    #10 0x00007f30367cc4e0 in SfxDispatcher::Update_Impl (this=0x561c0b151ec0, bForce=true) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1135
    #11 0x00007f303682374e in DispatcherUpdate_Impl (pArg=0x561c0b151ec0) at /home/michi/development/git/libreoffice/sfx2/source/control/shell.cxx:662
    #12 0x00007f303349e861 in Link<void*, void>::Call (this=0x561c0b87eae0, data=0x561c0b151ec0) at include/tools/link.hxx:105
    #13 0x00007f30334fb3c8 in svtools::AsynchronLink::HandleCall_PostUserEvent (this=0x561c0b87eae0) at /home/michi/development/git/libreoffice/svtools/source/control/asynclink.cxx:66
    #14 0x00007f30334fb31d in svtools::AsynchronLink::LinkStubHandleCall_PostUserEvent (instance=0x561c0b87eae0, data=0x0) at /home/michi/development/git/libreoffice/svtools/source/control/asynclink.cxx:58
    #15 0x00007f30310c86c1 in Link<void*, void>::Call (this=0x561c0b8811c8, data=0x0) at include/tools/link.hxx:105
    #16 0x00007f30310c48c1 in ImplHandleUserEvent (pSVEvent=0x561c0b8811c0) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2285
    #17 0x00007f30310c17ea in ImplWindowFrameProc (_pWindow=0x561c07e19360, nEvent=SalEvent::UserEvent, pEvent=0x561c0b8811c0) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2849
    #18 0x00007f3026f5523c in SalFrame::CallCallback (this=0x561c07b6bb80, nEvent=SalEvent::UserEvent, pEvent=0x561c0b8811c0) at vcl/inc/salframe.hxx:311
    #19 0x00007f3026f75d7f in QtInstance::ProcessEvent (this=0x561c066f4840, aEvent=...) at vcl/qt6/../qt5/QtInstance.cxx:527
    #20 0x00007f30317c879d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7ffd6c8cf850) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:119
    #21 0x00007f30317c8676 in SalUserEventList::DispatchUserEvents (this=0x561c066f4878, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:120
    #22 0x00007f3026f727c1 in QtInstance::ImplYield (this=0x561c066f4840, bWait=false, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:453
    #23 0x00007f3026f758e1 in QtInstance::DoYield (this=0x561c066f4840, bWait=false, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #24 0x00007f3031893896 in ImplYield (i_bWait=false, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #25 0x00007f30318934ab in Application::Reschedule (i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:409
    #26 0x00007f303736f734 in SbiRuntime::Step (this=0x561c0b2b4e50) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:778
    #27 0x00007f30372638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7ffd6c8d0810) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #28 0x00007f303726262d in SbModule::Run (this=0x561c0e7f98c0, pMeth=0x561c0d8d6080) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #29 0x00007f3037261b41 in SbModule::Notify (this=0x561c0e7f98c0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #30 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e851df0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #31 0x00007f303726879b in SbMethod::Broadcast (this=0x561c0e851d20, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #32 0x00007f30373b2a65 in SbxObject::Call (this=0x561c0e53fa50, rName="interceptor_queryDispatch", pParam=0x561c0cea64d0) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:273
    #33 0x00007f30371fa7a6 in StarBASIC::Call (this=0x561c0e53fa50, rName="interceptor_queryDispatch", pParam=0x561c0cea64d0) at /home/michi/development/git/libreoffice/basic/source/classes/sb.cxx:1318
    #34 0x00007f303722eeb5 in (anonymous namespace)::BasicAllListener_Impl::firing_impl (this=0x561c0e891750, Event=..., pRet=0x7ffd6c8d1218) at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:3852
    #35 0x00007f303722e9c1 in (anonymous namespace)::BasicAllListener_Impl::approveFiring (this=0x561c0e891750, Event=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:3882
    #36 0x00007f303722eb1c in non-virtual thunk to (anonymous namespace)::BasicAllListener_Impl::approveFiring(com::sun::star::script::AllEventObject const&) () at /home/michi/development/git/libreoffice/instdir/program/libsblo.so
    #37 0x00007f303722f5b8 in (anonymous namespace)::InvocationToAllListenerMapper::invoke (this=0x561c0e891280, FunctionName="queryDispatch", Params=uno::Sequence of length 3 = {...})
        at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:4002
    #38 0x00007f303722f8e4 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) () at /home/michi/development/git/libreoffice/instdir/program/libsblo.so
    #39 0x00007f30237370ed in gcc3::callVirtualMethod
        (pThis=0x561c0e8912a8, nVtableIndex=4, pRegisterReturn=0x7ffd6c8d1480, pReturnTypeRef=0x561c0670f930, bSimpleReturn=false, pStack=0x7ffd6c8d14a0, nStack=0, pGPR=0x7ffd6c8d1790, pFPR=0x7ffd6c8d1750)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:87
    #40 0x00007f3023735e5b in cpp_call (pThis=0x561c0e8915b0, aVtableSlot=..., pReturnTypeRef=0x561c0670f930, nParams=4, pParams=0x561c0e891c80, pUnoReturn=0x7ffd6c8d19f0, pUnoArgs=0x7ffd6c8d1a20, ppUnoExc=0x7ffd6c8d19d0)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:229
    #41 0x00007f3023735626 in unoInterfaceProxyDispatch (pUnoI=0x561c0e8915b0, pMemberDescr=0x561c0e893b50, pReturn=0x7ffd6c8d19f0, pArgs=0x7ffd6c8d1a20, ppException=0x7ffd6c8d19d0)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:409
    #42 0x00007f30112ef6f2 in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke (this=0x561c0e893aa0, pMemberType=0x561c0e8964c0, pReturn=0x7ffd6c8d1b40, pArgs=0x7ffd6c8d1ae0, ppException=0x7ffd6c8d1c70)
        at /home/michi/development/git/libreoffice/stoc/source/invocation_adapterfactory/iafactory.cxx:456
    #43 0x00007f30112eea48 in stoc_invadp::adapter_dispatch (pUnoI=0x561c0e8923f0, pMemberType=0x561c0e8964c0, pReturn=0x7ffd6c8d1b40, pArgs=0x7ffd6c8d1ae0, ppException=0x7ffd6c8d1c70)
        at /home/michi/development/git/libreoffice/stoc/source/invocation_adapterfactory/iafactory.cxx:604
    #44 0x00007f3023723fdb in cpp2uno_call
        (pThis=0x561c0e895580, pMemberTypeDescr=0x561c0e8964c0, pReturnTypeRef=0x561c082efdb0, nParams=3, pParams=0x561c0e8951c0, gpreg=0x7ffd6c8d2398, fpreg=0x7ffd6c8d23a0, ovrflw=0x7ffd6c8d23f0, pRegisterReturn=0x7ffd6c8d2350)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:190
    #45 0x00007f30237237f5 in cpp_vtable_call (nFunctionIndex=3, nVtableOffset=0, gpreg=0x7ffd6c8d2370, fpreg=0x7ffd6c8d23a0, ovrflw=0x7ffd6c8d23f0, pRegisterReturn=0x7ffd6c8d2350)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:388
    #46 0x00007f30237457a6 in privateSnippetExecutor () at /home/michi/development/git/libreoffice/instdir/program/libgcc3_uno.so
    #47 0x00007f303784bf19 in framework::InterceptionHelper::queryDispatch (this=0x561c07eea430, aURL=..., sTargetFrameName="", nSearchFlags=0) at /home/michi/development/git/libreoffice/framework/source/dispatch/interceptionhelper.cxx:87
    #48 0x00007f303784c03c in non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) () at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
    #49 0x00007f3037a04d31 in (anonymous namespace)::XFrameImpl::queryDispatch (this=0x561c07ef7d40, aURL=..., sTargetFrameName="", nSearchFlags=0) at /home/michi/development/git/libreoffice/framework/source/services/frame.cxx:2332
    #50 0x00007f3037a08b3c in non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) () at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
    #51 0x00007f30336b4d74 in svt::ToolboxController::bindListener (this=0x561c0e74d190) at /home/michi/development/git/libreoffice/svtools/source/uno/toolboxcontroller.cxx:513
    #52 0x00007f30336b4987 in svt::ToolboxController::update (this=0x561c0e74d190) at /home/michi/development/git/libreoffice/svtools/source/uno/toolboxcontroller.cxx:235
    #53 0x00007f3036cfff76 in sfx2::sidebar::ControllerFactory::CreateImageController (rxFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, rxParentWindow=uno::Reference to (VCLXToolBox *) 0x561c0cea66b0)
        at /home/michi/development/git/libreoffice/sfx2/source/sidebar/ControllerFactory.cxx:49
    #54 0x00007f3036cf3f71 in sfx2::sidebar::SidebarToolBox::SidebarToolBox (this=0x561c0e74bba0, vtt=0x7f3036ed3bd0 <VTT for sfx2::sidebar::(anonymous namespace)::NotebookbarToolBox+8>, pParentWindow=0x561c0e790ca0)
        at /home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarToolBox.cxx:75
    #55 0x00007f3036cf6688 in sfx2::sidebar::(anonymous namespace)::NotebookbarToolBox::NotebookbarToolBox (this=0x561c0e74bba0, pParentWindow=0x561c0e790ca0)
        at /home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarToolBox.cxx:318
    #56 0x00007f3036cf6312 in VclPtrInstance<sfx2::sidebar::(anonymous namespace)::NotebookbarToolBox>::VclPtrInstance<VclPtr<vcl::Window> const&> (this=0x7ffd6c8d2e80, arg=...) at include/vcl/vclptr.hxx:280
    #57 0x00007f3036cf6242 in makeNotebookbarToolBox (rRet=..., pParent=..., rMap=std::__debug::map with 7 elements = {...}) at /home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarToolBox.cxx:336
    #58 0x00007f3030e685dc in VclBuilder::makeObject (this=0x561c0e6fad80, pParent=0x561c0e790ca0, name="sfxlo-NotebookbarToolBox", id="SectionBottom", rMap=std::__debug::map with 7 elements = {...})
        at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:1991
    #59 0x00007f3030e6dd6e in VclBuilder::insertObject
        (this=0x561c0e6fad80, pParent=0x561c0e790ca0, rClass="sfxlo-NotebookbarToolBox", rID="SectionBottom", rProps=std::__debug::map with 7 elements = {...}, rPango=std::__debug::map with 0 elements, rAtk=std::__debug::map with 0 elements) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:2309
    #60 0x00007f3030ebcaba in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e790ca0, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:234
    #61 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e790ca0, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #62 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e0b7e00, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #63 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e0b7e00, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #64 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e0b7d10, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #65 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e0b7d10, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #66 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e75b7b0, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #67 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e75b7b0, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #68 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0d9b1f20, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #69 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0d9b1f20, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #70 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #71 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #72 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #73 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #74 0x00007f3030e7dd88 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::processUIFile (this=0x561c0e6fad80, pParent=0x561c0c2d0930) at include/vcl/widgetbuilder.hxx:70
    #75 0x00007f3030e598af in VclBuilder::VclBuilder
        (this=0x561c0e6fad80, pParent=0x561c0c2d0930, sUIDir=u"file:///home/michi/development/git/libreoffice/instdir/program/../share/config/soffice.cfg/", sUIFile="modules/swriter/ui/notebookbar.ui", sID="", xFrame=empty uno::Reference, bLegacy=true, pNotebookBarAddonsItem=0x7ffd6c8da430) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:531
    #76 0x00007f30311c39d2 in NotebookBar::NotebookBar
        (this=0x561c0c2d0930, pParent=0x561c07ed3110, rID="NotebookBar", rUIXMLDescription="modules/swriter/ui/notebookbar.ui", rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, aNotebookBarAddonsItem=...)
        at /home/michi/development/git/libreoffice/vcl/source/control/notebookbar.cxx:100
    #77 0x00007f3030e3eae4 in VclPtr<NotebookBar>::Create<ImplBorderWindow*, char const (&) [12], rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, NotebookBarAddonsItem const&>
        (arg=@0x7ffd6c8da0b8: 0x561c07ed3110, arg=..., arg="modules/swriter/ui/notebookbar.ui", arg=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, arg=...) at include/vcl/vclptr.hxx:129
    #78 0x00007f3030e3ca45 in ImplBorderWindow::SetNotebookBar
        (this=0x561c07ed3110, rUIXMLDescription="modules/swriter/ui/notebookbar.ui", rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, aNotebookBarAddonsItem=...)
        at /home/michi/development/git/libreoffice/vcl/source/window/brdwin.cxx:1945
    #79 0x00007f30310372ac in SystemWindow::SetNotebookBar
        (this=0x561c07f14910, rUIXMLDescription="modules/swriter/ui/notebookbar.ui", rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, aNotebookBarAddonsItem=..., bReloadNotebookbar=true)
        at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:916
    #80 0x00007f3036cabba1 in sfx2::SfxNotebookBar::StateMethod (pSysWindow=0x561c07f14910, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=true)
        at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:522
    #81 0x00007f3036cab110 in sfx2::SfxNotebookBar::StateMethod (rBindings=..., rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=true) at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:422
    #82 0x00007f3036cad6a2 in sfx2::SfxNotebookBar::ReloadNotebookBar (sUIPath=u"modules/swriter/ui/") at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:683
    #83 0x00007f3036e36b9b in SfxViewFrame::Notify (this=0x561c0b023e80, rHint=...) at /home/michi/development/git/libreoffice/sfx2/source/view/viewfrm.cxx:1574
    #84 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c07140db0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #85 0x00007f303665e339 in (anonymous namespace)::SfxEventAsyncer_Impl::IdleHdl (this=0x561c0c330660, pAsyncIdle=0x561c0c3318b0) at /home/michi/development/git/libreoffice/sfx2/source/appl/appcfg.cxx:109
    #86 0x00007f303665dead in (anonymous namespace)::SfxEventAsyncer_Impl::LinkStubIdleHdl (instance=0x561c0c330660, data=0x561c0c3318b0) at /home/michi/development/git/libreoffice/sfx2/source/appl/appcfg.cxx:102
    #87 0x00007f30318b9641 in Link<Timer*, void>::Call (this=0x561c0c3318d0, data=0x561c0c3318b0) at include/tools/link.hxx:105
    #88 0x00007f30318b94ac in Timer::Invoke (this=0x561c0c3318b0) at /home/michi/development/git/libreoffice/vcl/source/app/timer.cxx:75
    #89 0x00007f30318680b8 in Scheduler::CallbackTaskScheduling () at /home/michi/development/git/libreoffice/vcl/source/app/scheduler.cxx:509
    #90 0x00007f302703fad2 in SalTimer::CallCallback (this=0x561c07960ba0) at vcl/inc/saltimer.hxx:53
    #91 0x00007f302703ef6a in QtTimer::timeoutActivated (this=0x561c07960b90) at vcl/qt6/../qt5/QtTimer.cxx:51
    #92 0x00007f30270400a1 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtTimer::*)()>::call(void (QtTimer::*)(), QtTimer*, void**)::{lambda()#1}::operator()() const (this=0x7ffd6c8dd310)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtTimer::*)()>::call(void (QtTimer::*)(), QtTimer*, void**)::{lambda()#1}&&) (args=0x7ffd6c8dd6d0, fn=...)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #94 0x00007f302703ff0b in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtTimer::*)()>::call(void (QtTimer::*)(), QtTimer*, void**)
        (f=(void (QtTimer::*)(QtTimer * const)) 0x7f302703ee70 <QtTimer::timeoutActivated()>, o=0x561c07960b90, arg=0x7ffd6c8dd6d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #95 0x00007f302703fe8d in QtPrivate::FunctionPointer<void (QtTimer::*)()>::call<QtPrivate::List<>, void>(void (QtTimer::*)(), QtTimer*, void**)
        (f=(void (QtTimer::*)(QtTimer * const)) 0x7f302703ee70 <QtTimer::timeoutActivated()>, o=0x561c07960b90, arg=0x7ffd6c8dd6d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #96 0x00007f302703fdb6 in QtPrivate::QCallableObject<void (QtTimer::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
        (which=1, this_=0x561c07961090, r=0x561c07960b90, a=0x7ffd6c8dd6d0, ret=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #97 0x00007f302605fc52 in QtPrivate::QSlotObjectBase::call (this=0x561c07961090, r=0x561c07960b90, a=0x7ffd6c8dd6d0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #98 0x00007f302611e6e4 in doActivate<false> (sender=0x561c07960bb0, signal_index=3, argv=0x7ffd6c8dd6d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4128
    #99 0x00007f30261141b3 in QMetaObject::activate (sender=0x561c07960bb0, m=0x7f3026a10b18 <QTimer::staticMetaObject>, local_signal_index=0, argv=0x7ffd6c8dd6d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4188
    #100 0x00007f302614bb9b in QMetaObject::activate<void, QTimer::QPrivateSignal> (sender=0x561c07960bb0, mo=0x7f3026a10b18 <QTimer::staticMetaObject>, local_signal_index=0, ret=0x0, args=...)
        at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #101 0x00007f302614a3d5 in QTimer::timeout (this=0x561c07960bb0, _t1=...) at qtbase/src/corelib/Core_autogen/include/moc_qtimer.cpp:182
    #102 0x00007f302614a38f in QTimer::timerEvent (this=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qtimer.cpp:285
    #103 0x00007f302610aef6 in QObject::event (this=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1404
    #104 0x00007f3023fe2dc0 in QApplicationPrivate::notify_helper (this=0x561c06676ae0, receiver=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #105 0x00007f3023fe6cdd in QApplication::notify (this=0x561c06663e20, receiver=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #106 0x00007f3026049dc9 in QCoreApplication::notifyInternal2 (receiver=0x561c07960bb0, event=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #107 0x00007f302604aa39 in QCoreApplication::sendEvent (receiver=0x561c07960bb0, event=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1552
    #108 0x00007f30263dd90f in QTimerInfoList::activateTimers (this=0x561c066eff30) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qtimerinfo_unix.cpp:426
    #109 0x00007f302663b565 in timerSourceDispatch (source=0x561c066efed0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:152
    #110 0x00007f302663b844 in idleTimerSourceDispatch (source=0x561c066eff70) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:199
    #111 0x00007f302cd0b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #112 0x00007f302cd0da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #113 0x00007f302cd0e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #114 0x00007f302663a30b in QEventDispatcherGlib::processEvents (this=0x561c06667e80, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #115 0x00007f3025776a98 in QPAEventDispatcherGlib::processEvents (this=0x561c06667e80, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #116 0x00007f3026063980 in QEventLoop::processEvents (this=0x7ffd6c8de888, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:104
    #117 0x00007f3026063bd3 in QEventLoop::exec (this=0x7ffd6c8de888, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:186
    #118 0x00007f3024483eb7 in QDialog::exec (this=0x561c0e897c80) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:575
    #119 0x00007f3026fe0cfb in QtInstanceMessageDialog::run (this=0x561c0e7811b0) at vcl/qt6/../qt5/QtInstanceMessageDialog.cxx:159
    #120 0x00007f30373468c0 in SbRtl_MsgBox (rPar=...) at /home/michi/development/git/libreoffice/basic/source/runtime/methods.cxx:4242
    #121 0x00007f3037327ca2 in SbiStdObject::Notify (this=0x561c0e785e70, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/runtime/stdobj.cxx:1103
    #122 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e7b5620, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #123 0x00007f30373c7ad4 in SbxVariable::Broadcast (this=0x561c0e856200, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:154
    #124 0x00007f30373c04fd in SbxValue::SbxValue (this=0x561c0c2d1e10, vtt=0x7f30373eb6d0 <VTT for SbxMethod+16>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:68
    #125 0x00007f30373c6674 in SbxVariable::SbxVariable (this=0x561c0c2d1e10, vtt=0x7f30373eb6c8 <VTT for SbxMethod+8>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:48
    #126 0x00007f30373b6f4a in SbxMethod::SbxMethod (this=0x561c0c2d1e10, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:842
    #127 0x00007f303737782a in SbiRuntime::FindElement (this=0x561c0e890580, pObj=0x561c0e785e70, nOp1=32786, nOp2=2, nNotFound=..., bLocal=false, bStatic=false)
        at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:3701
    #128 0x00007f303736ab71 in SbiRuntime::StepRTL (this=0x561c0e890580, nOp1=32786, nOp2=2) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4124
    #129 0x00007f303736fa77 in SbiRuntime::Step (this=0x561c0e890580) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:808
    #130 0x00007f30372638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7ffd6c8df5d0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #131 0x00007f303726262d in SbModule::Run (this=0x561c0e7f98c0, pMeth=0x561c0e886740) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #132 0x00007f3037261b41 in SbModule::Notify (this=0x561c0e7f98c0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #133 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e850ce0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #134 0x00007f303726879b in SbMethod::Broadcast (this=0x561c0e850d60, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #135 0x00007f30373c04fd in SbxValue::SbxValue (this=0x561c0e87af00, vtt=0x7f30373eb6d0 <VTT for SbxMethod+16>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:68
    #136 0x00007f30373c6674 in SbxVariable::SbxVariable (this=0x561c0e87af00, vtt=0x7f30373eb6c8 <VTT for SbxMethod+8>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:48
    #137 0x00007f30373b6f4a in SbxMethod::SbxMethod (this=0x561c0e87af00, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:842
    #138 0x00007f303737782a in SbiRuntime::FindElement (this=0x561c0e854db0, pObj=0x561c0e7f98c0, nOp1=32775, nOp2=0, nNotFound=..., bLocal=true, bStatic=false)
        at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:3701
    #139 0x00007f3037378e95 in SbiRuntime::StepFIND_Impl (this=0x561c0e854db0, pObj=0x561c0e7f98c0, nOp1=32775, nOp2=0, nNotFound=..., bStatic=false) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4134
    #140 0x00007f303736ac0d in SbiRuntime::StepFIND (this=0x561c0e854db0, nOp1=32775, nOp2=0) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4140
    #141 0x00007f303736fa77 in SbiRuntime::Step (this=0x561c0e854db0) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:808
    #142 0x00007f30372638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7ffd6c8e04d0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #143 0x00007f303726262d in SbModule::Run (this=0x561c0e7f98c0, pMeth=0x561c0e8544a0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #144 0x00007f3037261b41 in SbModule::Notify (this=0x561c0e7f98c0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #145 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e850490, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #146 0x00007f303726879b in SbMethod::Broadcast (this=0x561c0e84e6b0, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #147 0x00007f30373c0ef3 in SbxValue::Get (this=0x561c0e84e6b0, rRes=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:290
    #148 0x00007f303726848b in SbMethod::Call (this=0x561c0e84e6b0, pRet=0x561c0e854c20, pCaller=0x0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2071
    #149 0x00007f301134bcfe in basprov::BasicScriptImpl::invoke (this=0x561c0e807880, aParams=uno::Sequence of length 1 = {...}, aOutParamIndex=empty uno::Sequence, aOutParam=empty uno::Sequence)
        at /home/michi/development/git/libreoffice/scripting/source/basprov/basscript.cxx:262
    #150 0x00007f301134c4ac in non-virtual thunk to basprov::BasicScriptImpl::invoke(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) () at /home/michi/development/git/libreoffice/instdir/program/../program/libbasprovlo.so
    #151 0x00007f3011258dc7 in scripting_protocolhandler::ScriptProtocolHandler::dispatchWithNotification (this=0x561c0b213f70, aURL=..., lArgs=uno::Sequence of length 1 = {...}, xListener=empty uno::Reference)
        at /home/michi/development/git/libreoffice/scripting/source/protocolhandler/scripthandler.cxx:213
    #152 0x00007f301125a2ef in scripting_protocolhandler::ScriptProtocolHandler::dispatch (this=0x561c0b213f70, aURL=..., lArgs=uno::Sequence of length 1 = {...})
        at /home/michi/development/git/libreoffice/scripting/source/protocolhandler/scripthandler.cxx:286
    #153 0x00007f3036cbe0ff in SfxEvents_Impl::Execute (aProperties=uno::Sequence of length 2 = {...}, aTrigger=..., pDoc=0x561c07140db0) at /home/michi/development/git/libreoffice/sfx2/source/notify/eventsupplier.cxx:268
    #154 0x00007f3036cbe474 in SfxEvents_Impl::documentEventOccured (this=0x561c0b104010, aEvent=...) at /home/michi/development/git/libreoffice/sfx2/source/notify/eventsupplier.cxx:293
    #155 0x00007f3036c40e77 in (anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent>::operator()
        (this=0x7ffd6c8e27c0, listener=uno::Reference to (SfxEvents_Impl *) 0x561c0b104040) at /home/michi/development/git/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3335
    #156 0x00007f3036c31e05 in comphelper::OInterfaceContainerHelper3<com::sun::star::document::XDocumentEventListener>::forEach<(anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent> > (this=0x561c0a9accf8, func=...) at include/comphelper/interfacecontainer3.hxx:275
    #157 0x00007f3036c31553 in SfxBaseModel::postEvent_Impl (this=0x561c0adc4440, aName="OnViewCreated", xController=uno::Reference to (SwXTextView *) 0x561c0b116e18, supplement=uno::Any(void))
        at /home/michi/development/git/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3369
    #158 0x00007f3036c30a7d in SfxBaseModel::Notify (this=0x561c0adc4440, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3002
    #159 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c07140db0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #160 0x00007f303665db14 in SfxApplication::NotifyEvent (this=0x561c07e29130, rEventHint=..., bSynchron=true) at /home/michi/development/git/libreoffice/sfx2/source/appl/appcfg.cxx:343
    #161 0x00007f3036e057ee in SfxBaseController::attachFrame (this=0x561c0b116df0, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0)
        at /home/michi/development/git/libreoffice/sfx2/source/view/sfxbasecontroller.cxx:536
    #162 0x00007f3036dd6519 in utl::ConnectFrameControllerModel
        (xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, xController=uno::Reference to (SwXTextView *) 0x561c0b116e18, xModel=uno::Reference to (SwXTextDocument *) 0x561c0adc44d0)
        at include/unotools/fcm.hxx:57
    #163 0x00007f3036dd2b21 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView
        (i_rModel=uno::Reference to (SwXTextDocument *) 0x561c0adc44d0, i_rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, i_rViewFactoryArgs=..., i_rViewName="Default")
        at /home/michi/development/git/libreoffice/sfx2/source/view/frmload.cxx:585
    #164 0x00007f3036dd00bc in (anonymous namespace)::SfxFrameLoader_Impl::load (this=0x561c07efffa0, rArgs=uno::Sequence of length 12 = {...}, _rTargetFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0)
        at /home/michi/development/git/libreoffice/sfx2/source/view/frmload.cxx:764
    #165 0x00007f30379c3004 in framework::LoadEnv::impl_loadContent (this=0x561c078f1e18) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1180
    #166 0x00007f30379c0165 in framework::LoadEnv::start (this=0x561c078f1e18) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:415
    #167 0x00007f30379bde12 in framework::LoadEnv::startLoading
        (this=0x561c078f1e18, sURL="file:///tmp/hyperlink.fodt", lMediaDescriptor=uno::Sequence of length 4 = {...}, xBaseFrame=uno::Reference to (framework::Desktop *) 0x561c079aab88, sTarget="_default", nSearchFlags=0, eFeature=(LoadEnvFeatures::WorkWithUI | LoadEnvFeatures::AllowContentHandler)) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:311
    #168 0x00007f3037856cd1 in framework::LoadDispatcher::impl_dispatch (this=0x561c078f1dc0, rURL=..., lArguments=uno::Sequence of length 4 = {...}, xListener=empty uno::Reference)
        at /home/michi/development/git/libreoffice/framework/source/dispatch/loaddispatcher.cxx:107
    #169 0x00007f3037857a31 in framework::LoadDispatcher::dispatchWithReturnValue (this=0x561c078f1dc0, rURL=..., lArguments=uno::Sequence of length 4 = {...})
        at /home/michi/development/git/libreoffice/framework/source/dispatch/loaddispatcher.cxx:60
    #170 0x00007f3037857ad4 in non-virtual thunk to framework::LoadDispatcher::dispatchWithReturnValue(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) ()
        at /home/michi/development/git/libreoffice/framework/source/dispatch/loaddispatcher.cxx:60
    #171 0x00007f3038e10e00 in comphelper::SynchronousDispatch::dispatch
        (xStartPoint=uno::Reference to (framework::Desktop *) 0x561c079aab78, sURL="file:///tmp/hyperlink.fodt", sTarget="_default", lArguments=uno::Sequence of length 4 = {...})
        at /home/michi/development/git/libreoffice/comphelper/source/misc/synchronousdispatch.cxx:62
    #172 0x00007f303a774d3d in desktop::DispatchWatcher::executeDispatchRequests (this=0x561c082f00b0, aDispatchRequestsList=std::__debug::vector of length 1, capacity 1 = {...}, bNoTerminate=false)
        at /home/michi/development/git/libreoffice/desktop/source/app/dispatchwatcher.cxx:529
    #173 0x00007f303a79307a in desktop::RequestHandler::ExecuteCmdLineRequests (aRequest=..., noTerminate=false) at /home/michi/development/git/libreoffice/desktop/source/app/officeipcthread.cxx:1347
    #174 0x00007f303a72d937 in desktop::Desktop::OpenClients () at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:2203
    #175 0x00007f303a72b8c3 in desktop::Desktop::OpenClients_Impl (this=0x7ffd6c8eaae0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1979
    #176 0x00007f303a729f5d in desktop::Desktop::LinkStubOpenClients_Impl (instance=0x7ffd6c8eaae0, data=0x0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1963
    #177 0x00007f30310c86c1 in Link<void*, void>::Call (this=0x561c07f3e718, data=0x0) at include/tools/link.hxx:105
    #178 0x00007f30310c48c1 in ImplHandleUserEvent (pSVEvent=0x561c07f3e710) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2285
    #179 0x00007f30310c17ea in ImplWindowFrameProc (_pWindow=0x561c07e19360, nEvent=SalEvent::UserEvent, pEvent=0x561c07f3e710) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2849
    #180 0x00007f3026f5523c in SalFrame::CallCallback (this=0x561c07b6bb80, nEvent=SalEvent::UserEvent, pEvent=0x561c07f3e710) at vcl/inc/salframe.hxx:311
    #181 0x00007f3026f75d7f in QtInstance::ProcessEvent (this=0x561c066f4840, aEvent=...) at vcl/qt6/../qt5/QtInstance.cxx:527
    #182 0x00007f30317c879d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7ffd6c8e8f20) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:119
    #183 0x00007f30317c8676 in SalUserEventList::DispatchUserEvents (this=0x561c066f4878, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:120
    #184 0x00007f3026f727c1 in QtInstance::ImplYield (this=0x561c066f4840, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:453
    #185 0x00007f3026f758e1 in QtInstance::DoYield (this=0x561c066f4840, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #186 0x00007f3031893896 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #187 0x00007f30318931af in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488
    #188 0x00007f3031892f90 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360
    #189 0x00007f303a727f39 in desktop::Desktop::Main (this=0x7ffd6c8eaae0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1679
    #190 0x00007f30318b4d16 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
    #191 0x00007f30318b6909 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
    #192 0x00007f303a7a181a in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
    #193 0x0000561bdaf4ba6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #194 0x0000561bdaf4ba47 in main (argc=2, argv=0x7ffd6c8eace8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

Change-Id: Ie10498c60554783b33aaa03070eebd8252ed9561
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180951
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Feb 1, 2025
Fix crash with the backtrace below when opening sample doc
attachment 198795 from tdf#164885 with macros enabled
when using the qt6 VCL plugin.

sfx2::SfxNotebookBar::StateMethod (frame 80) calls
SystemWindow::SetNotebookBar (frame 79) which calls
ImplBorderWindow::SetNotebookBar (frame 78) which
first disposes and clears the existing
ImplBorderWindow::mpNotebookBar and then creates
a new one.

However, calling the NotebookBar ctor triggers
a recursive call to sfx2::SfxNotebookBar::StateMethod
and SystemWindow::SetNotebookBar again (see frame 4).

When that one calls SystemWindow::SetNotebookBar,
it skips the logic to set a new NoteBookbar, but
the following call to the getter
SystemWindow::GetNotebookBar returns null, because
the previous ImplBorderWindow::SetNotebookBar (in frame 78, s. above)
hasn't finished yet.

For now, prevent such recursion from happening by
returning early in sfx2::SfxNotebookBar::StateMethod
if the NoteBookBar is already in the process of
getting set up.

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007f3030de3eb5 in std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:193
    193           pointer    _M_ptr() const noexcept { return std::get<0>(_M_t); }
    (rr) bt
    #0  0x00007f3030de3eb5 in std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:193
    #1  0x00007f3030de3e95 in std::unique_ptr<WindowImpl, std::default_delete<WindowImpl> >::get (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:465
    #2  0x00007f3030e1c6e5 in std::unique_ptr<WindowImpl, std::default_delete<WindowImpl> >::operator bool (this=0x8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:482
    #3  0x00007f30310a1c67 in vcl::Window::Show (this=0x0, bVisible=true, nFlags=ShowFlags::NONE) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:2193
    #4  0x00007f3036cabbf2 in sfx2::SfxNotebookBar::StateMethod (pSysWindow=0x561c07f14910, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=false)
        at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:524
    #5  0x00007f3036cab110 in sfx2::SfxNotebookBar::StateMethod (rBindings=..., rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=false) at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:422
    #6  0x00007f300b7bc406 in SwDocShell::GetState (this=0x561c07140db0, rSet=SfxItemSet of pool 0x561c07b742c0 with parent 0x0 and Which ranges: [(10338, 10338)])
        at /home/michi/development/git/libreoffice/sw/source/uibase/app/docsh.cxx:1117
    #7  0x00007f300b7bb7cd in SfxStubSwDocShellGetState (pShell=0x561c07140db0, rSet=SfxItemSet of pool 0x561c07b742c0 with parent 0x0 and Which ranges: [(10338, 10338)]) at workdir/SdiTarget/sw/sdi/swslots.hxx:1427
    #8  0x00007f3036822a3a in SfxShell::GetSlotState (this=0x561c07140db0, nSlotId=10338, pIF=0x561c0add4a90, pStateSet=0x0) at /home/michi/development/git/libreoffice/sfx2/source/control/shell.cxx:492
    #9  0x00007f30367d1278 in SfxDispatcher::QueryState (this=0x561c0b151ec0, nSlot=10338, rState=...) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:2030
    #10 0x00007f30367cc4e0 in SfxDispatcher::Update_Impl (this=0x561c0b151ec0, bForce=true) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1135
    #11 0x00007f303682374e in DispatcherUpdate_Impl (pArg=0x561c0b151ec0) at /home/michi/development/git/libreoffice/sfx2/source/control/shell.cxx:662
    #12 0x00007f303349e861 in Link<void*, void>::Call (this=0x561c0b87eae0, data=0x561c0b151ec0) at include/tools/link.hxx:105
    #13 0x00007f30334fb3c8 in svtools::AsynchronLink::HandleCall_PostUserEvent (this=0x561c0b87eae0) at /home/michi/development/git/libreoffice/svtools/source/control/asynclink.cxx:66
    #14 0x00007f30334fb31d in svtools::AsynchronLink::LinkStubHandleCall_PostUserEvent (instance=0x561c0b87eae0, data=0x0) at /home/michi/development/git/libreoffice/svtools/source/control/asynclink.cxx:58
    #15 0x00007f30310c86c1 in Link<void*, void>::Call (this=0x561c0b8811c8, data=0x0) at include/tools/link.hxx:105
    #16 0x00007f30310c48c1 in ImplHandleUserEvent (pSVEvent=0x561c0b8811c0) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2285
    #17 0x00007f30310c17ea in ImplWindowFrameProc (_pWindow=0x561c07e19360, nEvent=SalEvent::UserEvent, pEvent=0x561c0b8811c0) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2849
    #18 0x00007f3026f5523c in SalFrame::CallCallback (this=0x561c07b6bb80, nEvent=SalEvent::UserEvent, pEvent=0x561c0b8811c0) at vcl/inc/salframe.hxx:311
    #19 0x00007f3026f75d7f in QtInstance::ProcessEvent (this=0x561c066f4840, aEvent=...) at vcl/qt6/../qt5/QtInstance.cxx:527
    #20 0x00007f30317c879d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7ffd6c8cf850) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:119
    #21 0x00007f30317c8676 in SalUserEventList::DispatchUserEvents (this=0x561c066f4878, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:120
    #22 0x00007f3026f727c1 in QtInstance::ImplYield (this=0x561c066f4840, bWait=false, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:453
    #23 0x00007f3026f758e1 in QtInstance::DoYield (this=0x561c066f4840, bWait=false, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #24 0x00007f3031893896 in ImplYield (i_bWait=false, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #25 0x00007f30318934ab in Application::Reschedule (i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:409
    #26 0x00007f303736f734 in SbiRuntime::Step (this=0x561c0b2b4e50) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:778
    #27 0x00007f30372638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7ffd6c8d0810) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #28 0x00007f303726262d in SbModule::Run (this=0x561c0e7f98c0, pMeth=0x561c0d8d6080) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #29 0x00007f3037261b41 in SbModule::Notify (this=0x561c0e7f98c0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #30 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e851df0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #31 0x00007f303726879b in SbMethod::Broadcast (this=0x561c0e851d20, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #32 0x00007f30373b2a65 in SbxObject::Call (this=0x561c0e53fa50, rName="interceptor_queryDispatch", pParam=0x561c0cea64d0) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:273
    #33 0x00007f30371fa7a6 in StarBASIC::Call (this=0x561c0e53fa50, rName="interceptor_queryDispatch", pParam=0x561c0cea64d0) at /home/michi/development/git/libreoffice/basic/source/classes/sb.cxx:1318
    #34 0x00007f303722eeb5 in (anonymous namespace)::BasicAllListener_Impl::firing_impl (this=0x561c0e891750, Event=..., pRet=0x7ffd6c8d1218) at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:3852
    #35 0x00007f303722e9c1 in (anonymous namespace)::BasicAllListener_Impl::approveFiring (this=0x561c0e891750, Event=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:3882
    #36 0x00007f303722eb1c in non-virtual thunk to (anonymous namespace)::BasicAllListener_Impl::approveFiring(com::sun::star::script::AllEventObject const&) () at /home/michi/development/git/libreoffice/instdir/program/libsblo.so
    #37 0x00007f303722f5b8 in (anonymous namespace)::InvocationToAllListenerMapper::invoke (this=0x561c0e891280, FunctionName="queryDispatch", Params=uno::Sequence of length 3 = {...})
        at /home/michi/development/git/libreoffice/basic/source/classes/sbunoobj.cxx:4002
    #38 0x00007f303722f8e4 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) () at /home/michi/development/git/libreoffice/instdir/program/libsblo.so
    #39 0x00007f30237370ed in gcc3::callVirtualMethod
        (pThis=0x561c0e8912a8, nVtableIndex=4, pRegisterReturn=0x7ffd6c8d1480, pReturnTypeRef=0x561c0670f930, bSimpleReturn=false, pStack=0x7ffd6c8d14a0, nStack=0, pGPR=0x7ffd6c8d1790, pFPR=0x7ffd6c8d1750)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:87
    #40 0x00007f3023735e5b in cpp_call (pThis=0x561c0e8915b0, aVtableSlot=..., pReturnTypeRef=0x561c0670f930, nParams=4, pParams=0x561c0e891c80, pUnoReturn=0x7ffd6c8d19f0, pUnoArgs=0x7ffd6c8d1a20, ppUnoExc=0x7ffd6c8d19d0)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:229
    #41 0x00007f3023735626 in unoInterfaceProxyDispatch (pUnoI=0x561c0e8915b0, pMemberDescr=0x561c0e893b50, pReturn=0x7ffd6c8d19f0, pArgs=0x7ffd6c8d1a20, ppException=0x7ffd6c8d19d0)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:409
    #42 0x00007f30112ef6f2 in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke (this=0x561c0e893aa0, pMemberType=0x561c0e8964c0, pReturn=0x7ffd6c8d1b40, pArgs=0x7ffd6c8d1ae0, ppException=0x7ffd6c8d1c70)
        at /home/michi/development/git/libreoffice/stoc/source/invocation_adapterfactory/iafactory.cxx:456
    #43 0x00007f30112eea48 in stoc_invadp::adapter_dispatch (pUnoI=0x561c0e8923f0, pMemberType=0x561c0e8964c0, pReturn=0x7ffd6c8d1b40, pArgs=0x7ffd6c8d1ae0, ppException=0x7ffd6c8d1c70)
        at /home/michi/development/git/libreoffice/stoc/source/invocation_adapterfactory/iafactory.cxx:604
    #44 0x00007f3023723fdb in cpp2uno_call
        (pThis=0x561c0e895580, pMemberTypeDescr=0x561c0e8964c0, pReturnTypeRef=0x561c082efdb0, nParams=3, pParams=0x561c0e8951c0, gpreg=0x7ffd6c8d2398, fpreg=0x7ffd6c8d23a0, ovrflw=0x7ffd6c8d23f0, pRegisterReturn=0x7ffd6c8d2350)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:190
    #45 0x00007f30237237f5 in cpp_vtable_call (nFunctionIndex=3, nVtableOffset=0, gpreg=0x7ffd6c8d2370, fpreg=0x7ffd6c8d23a0, ovrflw=0x7ffd6c8d23f0, pRegisterReturn=0x7ffd6c8d2350)
        at /home/michi/development/git/libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:388
    #46 0x00007f30237457a6 in privateSnippetExecutor () at /home/michi/development/git/libreoffice/instdir/program/libgcc3_uno.so
    #47 0x00007f303784bf19 in framework::InterceptionHelper::queryDispatch (this=0x561c07eea430, aURL=..., sTargetFrameName="", nSearchFlags=0) at /home/michi/development/git/libreoffice/framework/source/dispatch/interceptionhelper.cxx:87
    #48 0x00007f303784c03c in non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) () at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
    #49 0x00007f3037a04d31 in (anonymous namespace)::XFrameImpl::queryDispatch (this=0x561c07ef7d40, aURL=..., sTargetFrameName="", nSearchFlags=0) at /home/michi/development/git/libreoffice/framework/source/services/frame.cxx:2332
    #50 0x00007f3037a08b3c in non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) () at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
    #51 0x00007f30336b4d74 in svt::ToolboxController::bindListener (this=0x561c0e74d190) at /home/michi/development/git/libreoffice/svtools/source/uno/toolboxcontroller.cxx:513
    #52 0x00007f30336b4987 in svt::ToolboxController::update (this=0x561c0e74d190) at /home/michi/development/git/libreoffice/svtools/source/uno/toolboxcontroller.cxx:235
    #53 0x00007f3036cfff76 in sfx2::sidebar::ControllerFactory::CreateImageController (rxFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, rxParentWindow=uno::Reference to (VCLXToolBox *) 0x561c0cea66b0)
        at /home/michi/development/git/libreoffice/sfx2/source/sidebar/ControllerFactory.cxx:49
    #54 0x00007f3036cf3f71 in sfx2::sidebar::SidebarToolBox::SidebarToolBox (this=0x561c0e74bba0, vtt=0x7f3036ed3bd0 <VTT for sfx2::sidebar::(anonymous namespace)::NotebookbarToolBox+8>, pParentWindow=0x561c0e790ca0)
        at /home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarToolBox.cxx:75
    #55 0x00007f3036cf6688 in sfx2::sidebar::(anonymous namespace)::NotebookbarToolBox::NotebookbarToolBox (this=0x561c0e74bba0, pParentWindow=0x561c0e790ca0)
        at /home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarToolBox.cxx:318
    #56 0x00007f3036cf6312 in VclPtrInstance<sfx2::sidebar::(anonymous namespace)::NotebookbarToolBox>::VclPtrInstance<VclPtr<vcl::Window> const&> (this=0x7ffd6c8d2e80, arg=...) at include/vcl/vclptr.hxx:280
    #57 0x00007f3036cf6242 in makeNotebookbarToolBox (rRet=..., pParent=..., rMap=std::__debug::map with 7 elements = {...}) at /home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarToolBox.cxx:336
    #58 0x00007f3030e685dc in VclBuilder::makeObject (this=0x561c0e6fad80, pParent=0x561c0e790ca0, name="sfxlo-NotebookbarToolBox", id="SectionBottom", rMap=std::__debug::map with 7 elements = {...})
        at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:1991
    #59 0x00007f3030e6dd6e in VclBuilder::insertObject
        (this=0x561c0e6fad80, pParent=0x561c0e790ca0, rClass="sfxlo-NotebookbarToolBox", rID="SectionBottom", rProps=std::__debug::map with 7 elements = {...}, rPango=std::__debug::map with 0 elements, rAtk=std::__debug::map with 0 elements) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:2309
    #60 0x00007f3030ebcaba in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e790ca0, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:234
    #61 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e790ca0, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #62 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e0b7e00, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #63 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e0b7e00, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #64 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e0b7d10, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #65 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e0b7d10, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #66 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0e75b7b0, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #67 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0e75b7b0, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #68 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0d9b1f20, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #69 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0d9b1f20, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #70 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #71 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #72 0x00007f3030ebcb92 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleObject
        (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., sType="", sInternalChild="", bToolbarItem=false) at include/vcl/widgetbuilder.hxx:237
    #73 0x00007f3030ebb52d in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::handleChild (this=0x561c0e6fad80, pParent=0x561c0c2d0930, pAtkProps=0x0, reader=..., bToolbarItem=false)
        at include/vcl/widgetbuilder.hxx:131
    #74 0x00007f3030e7dd88 in WidgetBuilder<vcl::Window, VclPtr<vcl::Window>, PopupMenu, VclPtr<PopupMenu> >::processUIFile (this=0x561c0e6fad80, pParent=0x561c0c2d0930) at include/vcl/widgetbuilder.hxx:70
    #75 0x00007f3030e598af in VclBuilder::VclBuilder
        (this=0x561c0e6fad80, pParent=0x561c0c2d0930, sUIDir=u"file:///home/michi/development/git/libreoffice/instdir/program/../share/config/soffice.cfg/", sUIFile="modules/swriter/ui/notebookbar.ui", sID="", xFrame=empty uno::Reference, bLegacy=true, pNotebookBarAddonsItem=0x7ffd6c8da430) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:531
    #76 0x00007f30311c39d2 in NotebookBar::NotebookBar
        (this=0x561c0c2d0930, pParent=0x561c07ed3110, rID="NotebookBar", rUIXMLDescription="modules/swriter/ui/notebookbar.ui", rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, aNotebookBarAddonsItem=...)
        at /home/michi/development/git/libreoffice/vcl/source/control/notebookbar.cxx:100
    #77 0x00007f3030e3eae4 in VclPtr<NotebookBar>::Create<ImplBorderWindow*, char const (&) [12], rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, NotebookBarAddonsItem const&>
        (arg=@0x7ffd6c8da0b8: 0x561c07ed3110, arg=..., arg="modules/swriter/ui/notebookbar.ui", arg=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, arg=...) at include/vcl/vclptr.hxx:129
    #78 0x00007f3030e3ca45 in ImplBorderWindow::SetNotebookBar
        (this=0x561c07ed3110, rUIXMLDescription="modules/swriter/ui/notebookbar.ui", rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, aNotebookBarAddonsItem=...)
        at /home/michi/development/git/libreoffice/vcl/source/window/brdwin.cxx:1945
    #79 0x00007f30310372ac in SystemWindow::SetNotebookBar
        (this=0x561c07f14910, rUIXMLDescription="modules/swriter/ui/notebookbar.ui", rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, aNotebookBarAddonsItem=..., bReloadNotebookbar=true)
        at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:916
    #80 0x00007f3036cabba1 in sfx2::SfxNotebookBar::StateMethod (pSysWindow=0x561c07f14910, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=true)
        at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:522
    #81 0x00007f3036cab110 in sfx2::SfxNotebookBar::StateMethod (rBindings=..., rUIFile=u"modules/swriter/ui/", bReloadNotebookbar=true) at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:422
    #82 0x00007f3036cad6a2 in sfx2::SfxNotebookBar::ReloadNotebookBar (sUIPath=u"modules/swriter/ui/") at /home/michi/development/git/libreoffice/sfx2/source/notebookbar/SfxNotebookBar.cxx:683
    #83 0x00007f3036e36b9b in SfxViewFrame::Notify (this=0x561c0b023e80, rHint=...) at /home/michi/development/git/libreoffice/sfx2/source/view/viewfrm.cxx:1574
    #84 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c07140db0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #85 0x00007f303665e339 in (anonymous namespace)::SfxEventAsyncer_Impl::IdleHdl (this=0x561c0c330660, pAsyncIdle=0x561c0c3318b0) at /home/michi/development/git/libreoffice/sfx2/source/appl/appcfg.cxx:109
    #86 0x00007f303665dead in (anonymous namespace)::SfxEventAsyncer_Impl::LinkStubIdleHdl (instance=0x561c0c330660, data=0x561c0c3318b0) at /home/michi/development/git/libreoffice/sfx2/source/appl/appcfg.cxx:102
    #87 0x00007f30318b9641 in Link<Timer*, void>::Call (this=0x561c0c3318d0, data=0x561c0c3318b0) at include/tools/link.hxx:105
    #88 0x00007f30318b94ac in Timer::Invoke (this=0x561c0c3318b0) at /home/michi/development/git/libreoffice/vcl/source/app/timer.cxx:75
    #89 0x00007f30318680b8 in Scheduler::CallbackTaskScheduling () at /home/michi/development/git/libreoffice/vcl/source/app/scheduler.cxx:509
    #90 0x00007f302703fad2 in SalTimer::CallCallback (this=0x561c07960ba0) at vcl/inc/saltimer.hxx:53
    #91 0x00007f302703ef6a in QtTimer::timeoutActivated (this=0x561c07960b90) at vcl/qt6/../qt5/QtTimer.cxx:51
    #92 0x00007f30270400a1 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtTimer::*)()>::call(void (QtTimer::*)(), QtTimer*, void**)::{lambda()#1}::operator()() const (this=0x7ffd6c8dd310)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtTimer::*)()>::call(void (QtTimer::*)(), QtTimer*, void**)::{lambda()#1}&&) (args=0x7ffd6c8dd6d0, fn=...)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #94 0x00007f302703ff0b in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtTimer::*)()>::call(void (QtTimer::*)(), QtTimer*, void**)
        (f=(void (QtTimer::*)(QtTimer * const)) 0x7f302703ee70 <QtTimer::timeoutActivated()>, o=0x561c07960b90, arg=0x7ffd6c8dd6d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #95 0x00007f302703fe8d in QtPrivate::FunctionPointer<void (QtTimer::*)()>::call<QtPrivate::List<>, void>(void (QtTimer::*)(), QtTimer*, void**)
        (f=(void (QtTimer::*)(QtTimer * const)) 0x7f302703ee70 <QtTimer::timeoutActivated()>, o=0x561c07960b90, arg=0x7ffd6c8dd6d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #96 0x00007f302703fdb6 in QtPrivate::QCallableObject<void (QtTimer::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
        (which=1, this_=0x561c07961090, r=0x561c07960b90, a=0x7ffd6c8dd6d0, ret=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #97 0x00007f302605fc52 in QtPrivate::QSlotObjectBase::call (this=0x561c07961090, r=0x561c07960b90, a=0x7ffd6c8dd6d0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #98 0x00007f302611e6e4 in doActivate<false> (sender=0x561c07960bb0, signal_index=3, argv=0x7ffd6c8dd6d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4128
    #99 0x00007f30261141b3 in QMetaObject::activate (sender=0x561c07960bb0, m=0x7f3026a10b18 <QTimer::staticMetaObject>, local_signal_index=0, argv=0x7ffd6c8dd6d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4188
    #100 0x00007f302614bb9b in QMetaObject::activate<void, QTimer::QPrivateSignal> (sender=0x561c07960bb0, mo=0x7f3026a10b18 <QTimer::staticMetaObject>, local_signal_index=0, ret=0x0, args=...)
        at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #101 0x00007f302614a3d5 in QTimer::timeout (this=0x561c07960bb0, _t1=...) at qtbase/src/corelib/Core_autogen/include/moc_qtimer.cpp:182
    #102 0x00007f302614a38f in QTimer::timerEvent (this=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qtimer.cpp:285
    #103 0x00007f302610aef6 in QObject::event (this=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1404
    #104 0x00007f3023fe2dc0 in QApplicationPrivate::notify_helper (this=0x561c06676ae0, receiver=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #105 0x00007f3023fe6cdd in QApplication::notify (this=0x561c06663e20, receiver=0x561c07960bb0, e=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #106 0x00007f3026049dc9 in QCoreApplication::notifyInternal2 (receiver=0x561c07960bb0, event=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #107 0x00007f302604aa39 in QCoreApplication::sendEvent (receiver=0x561c07960bb0, event=0x7ffd6c8de470) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1552
    #108 0x00007f30263dd90f in QTimerInfoList::activateTimers (this=0x561c066eff30) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qtimerinfo_unix.cpp:426
    #109 0x00007f302663b565 in timerSourceDispatch (source=0x561c066efed0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:152
    #110 0x00007f302663b844 in idleTimerSourceDispatch (source=0x561c066eff70) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:199
    #111 0x00007f302cd0b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #112 0x00007f302cd0da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #113 0x00007f302cd0e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #114 0x00007f302663a30b in QEventDispatcherGlib::processEvents (this=0x561c06667e80, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #115 0x00007f3025776a98 in QPAEventDispatcherGlib::processEvents (this=0x561c06667e80, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #116 0x00007f3026063980 in QEventLoop::processEvents (this=0x7ffd6c8de888, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:104
    #117 0x00007f3026063bd3 in QEventLoop::exec (this=0x7ffd6c8de888, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:186
    #118 0x00007f3024483eb7 in QDialog::exec (this=0x561c0e897c80) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:575
    #119 0x00007f3026fe0cfb in QtInstanceMessageDialog::run (this=0x561c0e7811b0) at vcl/qt6/../qt5/QtInstanceMessageDialog.cxx:159
    #120 0x00007f30373468c0 in SbRtl_MsgBox (rPar=...) at /home/michi/development/git/libreoffice/basic/source/runtime/methods.cxx:4242
    #121 0x00007f3037327ca2 in SbiStdObject::Notify (this=0x561c0e785e70, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/runtime/stdobj.cxx:1103
    #122 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e7b5620, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #123 0x00007f30373c7ad4 in SbxVariable::Broadcast (this=0x561c0e856200, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:154
    #124 0x00007f30373c04fd in SbxValue::SbxValue (this=0x561c0c2d1e10, vtt=0x7f30373eb6d0 <VTT for SbxMethod+16>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:68
    #125 0x00007f30373c6674 in SbxVariable::SbxVariable (this=0x561c0c2d1e10, vtt=0x7f30373eb6c8 <VTT for SbxMethod+8>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:48
    #126 0x00007f30373b6f4a in SbxMethod::SbxMethod (this=0x561c0c2d1e10, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:842
    #127 0x00007f303737782a in SbiRuntime::FindElement (this=0x561c0e890580, pObj=0x561c0e785e70, nOp1=32786, nOp2=2, nNotFound=..., bLocal=false, bStatic=false)
        at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:3701
    #128 0x00007f303736ab71 in SbiRuntime::StepRTL (this=0x561c0e890580, nOp1=32786, nOp2=2) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4124
    #129 0x00007f303736fa77 in SbiRuntime::Step (this=0x561c0e890580) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:808
    #130 0x00007f30372638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7ffd6c8df5d0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #131 0x00007f303726262d in SbModule::Run (this=0x561c0e7f98c0, pMeth=0x561c0e886740) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #132 0x00007f3037261b41 in SbModule::Notify (this=0x561c0e7f98c0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #133 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e850ce0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #134 0x00007f303726879b in SbMethod::Broadcast (this=0x561c0e850d60, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #135 0x00007f30373c04fd in SbxValue::SbxValue (this=0x561c0e87af00, vtt=0x7f30373eb6d0 <VTT for SbxMethod+16>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:68
    #136 0x00007f30373c6674 in SbxVariable::SbxVariable (this=0x561c0e87af00, vtt=0x7f30373eb6c8 <VTT for SbxMethod+8>, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvar.cxx:48
    #137 0x00007f30373b6f4a in SbxMethod::SbxMethod (this=0x561c0e87af00, r=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxobj.cxx:842
    #138 0x00007f303737782a in SbiRuntime::FindElement (this=0x561c0e854db0, pObj=0x561c0e7f98c0, nOp1=32775, nOp2=0, nNotFound=..., bLocal=true, bStatic=false)
        at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:3701
    #139 0x00007f3037378e95 in SbiRuntime::StepFIND_Impl (this=0x561c0e854db0, pObj=0x561c0e7f98c0, nOp1=32775, nOp2=0, nNotFound=..., bStatic=false) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4134
    #140 0x00007f303736ac0d in SbiRuntime::StepFIND (this=0x561c0e854db0, nOp1=32775, nOp2=0) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:4140
    #141 0x00007f303736fa77 in SbiRuntime::Step (this=0x561c0e854db0) at /home/michi/development/git/libreoffice/basic/source/runtime/runtime.cxx:808
    #142 0x00007f30372638c9 in (anonymous namespace)::RunInitGuard::run (this=0x7ffd6c8e04d0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1017
    #143 0x00007f303726262d in SbModule::Run (this=0x561c0e7f98c0, pMeth=0x561c0e8544a0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:1177
    #144 0x00007f3037261b41 in SbModule::Notify (this=0x561c0e7f98c0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:775
    #145 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c0e850490, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #146 0x00007f303726879b in SbMethod::Broadcast (this=0x561c0e84e6b0, nHintId=SfxHintId::BasicDataWanted) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2115
    #147 0x00007f30373c0ef3 in SbxValue::Get (this=0x561c0e84e6b0, rRes=...) at /home/michi/development/git/libreoffice/basic/source/sbx/sbxvalue.cxx:290
    #148 0x00007f303726848b in SbMethod::Call (this=0x561c0e84e6b0, pRet=0x561c0e854c20, pCaller=0x0) at /home/michi/development/git/libreoffice/basic/source/classes/sbxmod.cxx:2071
    #149 0x00007f301134bcfe in basprov::BasicScriptImpl::invoke (this=0x561c0e807880, aParams=uno::Sequence of length 1 = {...}, aOutParamIndex=empty uno::Sequence, aOutParam=empty uno::Sequence)
        at /home/michi/development/git/libreoffice/scripting/source/basprov/basscript.cxx:262
    #150 0x00007f301134c4ac in non-virtual thunk to basprov::BasicScriptImpl::invoke(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) () at /home/michi/development/git/libreoffice/instdir/program/../program/libbasprovlo.so
    #151 0x00007f3011258dc7 in scripting_protocolhandler::ScriptProtocolHandler::dispatchWithNotification (this=0x561c0b213f70, aURL=..., lArgs=uno::Sequence of length 1 = {...}, xListener=empty uno::Reference)
        at /home/michi/development/git/libreoffice/scripting/source/protocolhandler/scripthandler.cxx:213
    #152 0x00007f301125a2ef in scripting_protocolhandler::ScriptProtocolHandler::dispatch (this=0x561c0b213f70, aURL=..., lArgs=uno::Sequence of length 1 = {...})
        at /home/michi/development/git/libreoffice/scripting/source/protocolhandler/scripthandler.cxx:286
    #153 0x00007f3036cbe0ff in SfxEvents_Impl::Execute (aProperties=uno::Sequence of length 2 = {...}, aTrigger=..., pDoc=0x561c07140db0) at /home/michi/development/git/libreoffice/sfx2/source/notify/eventsupplier.cxx:268
    #154 0x00007f3036cbe474 in SfxEvents_Impl::documentEventOccured (this=0x561c0b104010, aEvent=...) at /home/michi/development/git/libreoffice/sfx2/source/notify/eventsupplier.cxx:293
    #155 0x00007f3036c40e77 in (anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent>::operator()
        (this=0x7ffd6c8e27c0, listener=uno::Reference to (SfxEvents_Impl *) 0x561c0b104040) at /home/michi/development/git/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3335
    #156 0x00007f3036c31e05 in comphelper::OInterfaceContainerHelper3<com::sun::star::document::XDocumentEventListener>::forEach<(anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent> > (this=0x561c0a9accf8, func=...) at include/comphelper/interfacecontainer3.hxx:275
    #157 0x00007f3036c31553 in SfxBaseModel::postEvent_Impl (this=0x561c0adc4440, aName="OnViewCreated", xController=uno::Reference to (SwXTextView *) 0x561c0b116e18, supplement=uno::Any(void))
        at /home/michi/development/git/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3369
    #158 0x00007f3036c30a7d in SfxBaseModel::Notify (this=0x561c0adc4440, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3002
    #159 0x00007f3035d51a4c in SfxBroadcaster::Broadcast (this=0x561c07140db0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #160 0x00007f303665db14 in SfxApplication::NotifyEvent (this=0x561c07e29130, rEventHint=..., bSynchron=true) at /home/michi/development/git/libreoffice/sfx2/source/appl/appcfg.cxx:343
    #161 0x00007f3036e057ee in SfxBaseController::attachFrame (this=0x561c0b116df0, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0)
        at /home/michi/development/git/libreoffice/sfx2/source/view/sfxbasecontroller.cxx:536
    #162 0x00007f3036dd6519 in utl::ConnectFrameControllerModel
        (xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, xController=uno::Reference to (SwXTextView *) 0x561c0b116e18, xModel=uno::Reference to (SwXTextDocument *) 0x561c0adc44d0)
        at include/unotools/fcm.hxx:57
    #163 0x00007f3036dd2b21 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView
        (i_rModel=uno::Reference to (SwXTextDocument *) 0x561c0adc44d0, i_rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0, i_rViewFactoryArgs=..., i_rViewName="Default")
        at /home/michi/development/git/libreoffice/sfx2/source/view/frmload.cxx:585
    #164 0x00007f3036dd00bc in (anonymous namespace)::SfxFrameLoader_Impl::load (this=0x561c07efffa0, rArgs=uno::Sequence of length 12 = {...}, _rTargetFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x561c07ef7db0)
        at /home/michi/development/git/libreoffice/sfx2/source/view/frmload.cxx:764
    #165 0x00007f30379c3004 in framework::LoadEnv::impl_loadContent (this=0x561c078f1e18) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1180
    #166 0x00007f30379c0165 in framework::LoadEnv::start (this=0x561c078f1e18) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:415
    #167 0x00007f30379bde12 in framework::LoadEnv::startLoading
        (this=0x561c078f1e18, sURL="file:///tmp/hyperlink.fodt", lMediaDescriptor=uno::Sequence of length 4 = {...}, xBaseFrame=uno::Reference to (framework::Desktop *) 0x561c079aab88, sTarget="_default", nSearchFlags=0, eFeature=(LoadEnvFeatures::WorkWithUI | LoadEnvFeatures::AllowContentHandler)) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:311
    #168 0x00007f3037856cd1 in framework::LoadDispatcher::impl_dispatch (this=0x561c078f1dc0, rURL=..., lArguments=uno::Sequence of length 4 = {...}, xListener=empty uno::Reference)
        at /home/michi/development/git/libreoffice/framework/source/dispatch/loaddispatcher.cxx:107
    #169 0x00007f3037857a31 in framework::LoadDispatcher::dispatchWithReturnValue (this=0x561c078f1dc0, rURL=..., lArguments=uno::Sequence of length 4 = {...})
        at /home/michi/development/git/libreoffice/framework/source/dispatch/loaddispatcher.cxx:60
    #170 0x00007f3037857ad4 in non-virtual thunk to framework::LoadDispatcher::dispatchWithReturnValue(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) ()
        at /home/michi/development/git/libreoffice/framework/source/dispatch/loaddispatcher.cxx:60
    #171 0x00007f3038e10e00 in comphelper::SynchronousDispatch::dispatch
        (xStartPoint=uno::Reference to (framework::Desktop *) 0x561c079aab78, sURL="file:///tmp/hyperlink.fodt", sTarget="_default", lArguments=uno::Sequence of length 4 = {...})
        at /home/michi/development/git/libreoffice/comphelper/source/misc/synchronousdispatch.cxx:62
    #172 0x00007f303a774d3d in desktop::DispatchWatcher::executeDispatchRequests (this=0x561c082f00b0, aDispatchRequestsList=std::__debug::vector of length 1, capacity 1 = {...}, bNoTerminate=false)
        at /home/michi/development/git/libreoffice/desktop/source/app/dispatchwatcher.cxx:529
    #173 0x00007f303a79307a in desktop::RequestHandler::ExecuteCmdLineRequests (aRequest=..., noTerminate=false) at /home/michi/development/git/libreoffice/desktop/source/app/officeipcthread.cxx:1347
    #174 0x00007f303a72d937 in desktop::Desktop::OpenClients () at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:2203
    #175 0x00007f303a72b8c3 in desktop::Desktop::OpenClients_Impl (this=0x7ffd6c8eaae0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1979
    #176 0x00007f303a729f5d in desktop::Desktop::LinkStubOpenClients_Impl (instance=0x7ffd6c8eaae0, data=0x0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1963
    #177 0x00007f30310c86c1 in Link<void*, void>::Call (this=0x561c07f3e718, data=0x0) at include/tools/link.hxx:105
    #178 0x00007f30310c48c1 in ImplHandleUserEvent (pSVEvent=0x561c07f3e710) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2285
    #179 0x00007f30310c17ea in ImplWindowFrameProc (_pWindow=0x561c07e19360, nEvent=SalEvent::UserEvent, pEvent=0x561c07f3e710) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2849
    #180 0x00007f3026f5523c in SalFrame::CallCallback (this=0x561c07b6bb80, nEvent=SalEvent::UserEvent, pEvent=0x561c07f3e710) at vcl/inc/salframe.hxx:311
    #181 0x00007f3026f75d7f in QtInstance::ProcessEvent (this=0x561c066f4840, aEvent=...) at vcl/qt6/../qt5/QtInstance.cxx:527
    #182 0x00007f30317c879d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7ffd6c8e8f20) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:119
    #183 0x00007f30317c8676 in SalUserEventList::DispatchUserEvents (this=0x561c066f4878, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:120
    #184 0x00007f3026f727c1 in QtInstance::ImplYield (this=0x561c066f4840, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:453
    #185 0x00007f3026f758e1 in QtInstance::DoYield (this=0x561c066f4840, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #186 0x00007f3031893896 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #187 0x00007f30318931af in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488
    #188 0x00007f3031892f90 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360
    #189 0x00007f303a727f39 in desktop::Desktop::Main (this=0x7ffd6c8eaae0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1679
    #190 0x00007f30318b4d16 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
    #191 0x00007f30318b6909 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
    #192 0x00007f303a7a181a in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
    #193 0x0000561bdaf4ba6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #194 0x0000561bdaf4ba47 in main (argc=2, argv=0x7ffd6c8eace8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

Change-Id: Ie10498c60554783b33aaa03070eebd8252ed9561
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180951
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
(cherry picked from commit 5797e54)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180971
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Feb 4, 2025
When opening the popup menu by right-clicking on a Writer
comment and selecting "Delete All Comments", the SwAnnotationWin
(`mrSidebarWin`) gets disposed while the popup menu and its associated
MenuFloatingWindow are still alive. With the menu floating window
being a child of the SwAnnotationWin, that would trigger the
below assert since

    commit 6708246
    Author: Michael Weghorn <[email protected]>
    Date:   Thu Dec 5 11:06:48 2024 +0000

        tdf#164093 tdf#157001 a11y: Improve menu window disposal

Avoid disposing parent window before its child by not using
the SwAnnotationWin, but its parent as the popup menu
parent.

    warn:legacy.osl:64828:64828:vcl/source/window/window.cxx:307: Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()
    Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()
    [New Thread 64828.64829]
    [New Thread 64828.64830]
    [New Thread 64828.64831]
    [New Thread 64828.64832]
    [New Thread 64828.64833]
    [New Thread 64828.64835]

    Thread 1 received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (rr) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f580ac9de2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f580ac49d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f580ac324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f5801fbc2cb in SalAbort (rErrorText="Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()", bDumpCore=true)
        at /home/michi/development/git/libreoffice/vcl/source/app/salplug.cxx:403
    #5  0x00007f5802087961 in Application::Abort (rErrorText="Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()")
        at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:300
    #6  0x00007f580188bba8 in vcl::Window::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:308
    #7  0x00007f5801902216 in Control::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/control/ctrl.cxx:61
    #8  0x00007f58019552cc in InterimItemWindow::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/control/InterimItemWindow.cxx:54
    #9  0x00007f57ca8fb980 in sw::annotation::SwAnnotationWin::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/AnnotationWin.cxx:189
    #10 0x00007f5801b06ee3 in VclReferenceBase::disposeOnce (this=0x55711f0667e8) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #11 0x00007f57ca939d52 in VclPtr<sw::annotation::SwAnnotationWin>::disposeAndClear (this=0x5571205dc3e0) at include/vcl/vclptr.hxx:207
    #12 0x00007f57ca9260b5 in SwPostItMgr::RemoveItem (this=0x55711a340eb0, pBroadcast=0x55711fe07bb0) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:529
    #13 0x00007f57ca926662 in SwPostItMgr::Notify (this=0x55711a340eb0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:595
    #14 0x00007f5806551a4c in SfxBroadcaster::Broadcast (this=0x55711fe07bb0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #15 0x00007f57ca0e62c9 in SwpHints::DeleteAtPos (this=0x5571215061d0, nPos=0) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/thints.cxx:3440
    #16 0x00007f57ca0b31d1 in SwTextNode::EraseText (this=0x55711a2d3070, rIdx=SwContentIndex (node 9 offset 4), nCount=1, nMode=SwInsertFlags::DEFAULT) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/ndtxt.cxx:2877
    #17 0x00007f57ca0b501d in SwTextNode::EraseText (this=0x55711a2d3070, rIdx=SwPosition (node 9, offset 4), nCount=1, nMode=SwInsertFlags::DEFAULT) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/ndtxt.cxx:2837
    #18 0x00007f57ca1494c2 in SwUndoDelete::SaveContent (this=0x557121daf110, pStart=0x7ffcf6391340, pEnd=0x7ffcf6391388, pSttTextNd=0x55711a2d3070, pEndTextNd=0x55711a2d3070)
        at /home/michi/development/git/libreoffice/sw/source/core/undo/undel.cxx:476
    #19 0x00007f57ca147457 in SwUndoDelete::SwUndoDelete (this=0x557121daf110, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection, bFullPara=false, bCalledByTableCpy=false)
        at /home/michi/development/git/libreoffice/sw/source/core/undo/undel.cxx:264
    #20 0x00007f57c97e72e8 in std::make_unique<SwUndoDelete, SwPaM&, SwDeleteFlags const&> (__args=SwPaM = {...}, __args=@0x7ffcf6391214: SwDeleteFlags::ArtificialSelection)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:1077
    #21 0x00007f57c97d79a1 in sw::DocumentContentOperationsManager::DeleteRangeImplImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4574
    #22 0x00007f57c97bf899 in sw::DocumentContentOperationsManager::DeleteRangeImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4500
    #23 0x00007f57c97c2cf9 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4471
    #24 0x00007f57c97bfc2d in (anonymous namespace)::lcl_DoWithBreaks
        (rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection, pFunc=(bool (sw::DocumentContentOperationsManager::*)(class sw::DocumentContentOperationsManager * const, class SwPaM &, enum SwDeleteFlags)) 0x7f57c97c2cb0 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:686
    #25 0x00007f57c97c1773 in sw::DocumentContentOperationsManager::DeleteAndJoin (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2377
    #26 0x00007f57c9a7ef97 in SwEditShell::DeleteSel (this=0x55711b0054e0, rPam=SwPaM = {...}, isArtificialSelection=true, goLeft=false, pUndo=0x7ffcf6391d9f) at /home/michi/development/git/libreoffice/sw/source/core/edit/eddel.cxx:122
    #27 0x00007f57c9a7f538 in SwEditShell::Delete (this=0x55711b0054e0, isArtificialSelection=true, goLeft=false) at /home/michi/development/git/libreoffice/sw/source/core/edit/eddel.cxx:164
    #28 0x00007f57cae1c83b in SwWrtShell::DelRight (this=0x55711b0054e0, isReplaceHeuristic=false) at /home/michi/development/git/libreoffice/sw/source/uibase/wrtsh/delete.cxx:419
    #29 0x00007f57ca930aaa in SwPostItMgr::Delete (this=0x55711a340eb0) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:1770
    #30 0x00007f57caa8d050 in SwAnnotationShell::NoteExec (this=0x55711eef12c0, rReq=...) at /home/michi/development/git/libreoffice/sw/source/uibase/shells/annotsh.cxx:1170
    #31 0x00007f57caa8cf15 in SfxStubSwAnnotationShellNoteExec (pShell=0x55711eef12c0, rReq=...) at workdir/SdiTarget/sw/sdi/swslots.hxx:19464
    #32 0x00007f5806fc9fbe in SfxDispatcher::Call_Impl (this=0x55711ae7d3b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:255
    #33 0x00007f5806fce446 in SfxDispatcher::Execute_ (this=0x55711ae7d3b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:754
    #34 0x00007f5806fb6c8e in SfxBindings::Execute_Impl (this=0x55711de05e80, aReq=..., pSlot=0x7f57caf33a18 <aSwAnnotationShellSlots_Impl+8712>, pShell=0x55711eef12c0)
        at /home/michi/development/git/libreoffice/sfx2/source/control/bindings.cxx:1045
    #35 0x00007f580709d8bd in SfxDispatchController_Impl::dispatch (this=0x55711e141080, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:735
    #36 0x00007f580709c374 in SfxOfficeDispatch::dispatch (this=0x55711e140fe0, aURL=..., aArgs=empty uno::Sequence) at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:254
    #37 0x00007f5808307ddb in framework::MenuBarManager::Select (this=0x55711fe3b8c0, pMenu=0x5571215e12b0) at /home/michi/development/git/libreoffice/framework/source/uielement/menubarmanager.cxx:821
    #38 0x00007f580830784d in framework::MenuBarManager::LinkStubSelect (instance=0x55711fe3b8c0, data=0x5571215e12b0) at /home/michi/development/git/libreoffice/framework/source/uielement/menubarmanager.cxx:776
    #39 0x00007f58017a64f6 in Link<Menu*, bool>::Call (this=0x5571215e1320, data=0x5571215e12b0) at include/tools/link.hxx:105
    #40 0x00007f5801798233 in Menu::Select (this=0x5571215e12b0) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:352
    #41 0x00007f58017a56a8 in PopupMenu::ImplFlushPendingSelect (this=0x5571215e12b0) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2872
    #42 0x00007f58017a5ced in PopupMenu::FinishRun (this=0x5571215e12b0, pWin=..., pParentWin=..., bRealExecute=true, bIsNativeMenu=true) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:3108
    #43 0x00007f58017a5487 in PopupMenu::ImplExecute
        (this=0x5571215e12b0, pParentWin=..., rRect=..., nPopupModeFlags=(FloatWinPopupFlags::Down | FloatWinPopupFlags::NoKeyClose | FloatWinPopupFlags::AllMouseButtonClose | FloatWinPopupFlags::NewLevel | FloatWinPopupFlags::NoMouseUpClose | FloatWinPopupFlags::GrabFocus), pSFrom=0x0, bPreSelectFirst=false) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:3033
    #44 0x00007f58017a3eca in PopupMenu::Execute (this=0x5571215e12b0, pExecWindow=0x55711f066550, rRect=..., nFlags=(PopupMenuFlags::ExecuteDown | PopupMenuFlags::NoMouseUpClose))
        at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2860
    #45 0x00007f58034b67d3 in VCLXMenu::execute (this=0x5571215df5a0, rxWindowPeer=uno::Reference to (VCLXWindow *) 0x55711ef4bbe8, rPos=..., nFlags=1) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxmenu.cxx:509
    #46 0x00007f5806fd2d91 in SfxDispatcher::ExecutePopup (this=0x55711ae7d3b0, rResName="annotation", pWin=0x55711f066550, pPos=0x7ffcf6394968) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1937
    #47 0x00007f5806fd2186 in SfxDispatcher::ExecutePopup (pWin=0x55711f066550, pPos=0x7ffcf6394968) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1785
    #48 0x00007f57ca95d2c3 in sw::sidebarwindows::SidebarTextControl::Command (this=0x5571215354d0, rCEvt=...) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/SidebarTxtControl.cxx:443
    #49 0x00007f5801fb39e1 in weld::CustomWeld::DoCommand (this=0x557121536330, rPos=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:93
    #50 0x00007f5801fb371d in weld::CustomWeld::LinkStubDoCommand (instance=0x557121536330, data=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:91
    #51 0x00007f57f7799bb6 in Link<CommandEvent const&, bool>::Call (this=0x55711a2c0bd0, data=...) at include/tools/link.hxx:105
    #52 0x00007f57f7703ba8 in (anonymous namespace)::GtkInstanceDrawingArea::signal_command (this=0x55711a2c0900, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:19099
    #53 0x00007f57f7701f3d in (anonymous namespace)::GtkInstanceDrawingArea::signal_popup_menu (this=0x55711a2c0900, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:18731
    #54 0x00007f57f76e3cc7 in (anonymous namespace)::GtkInstanceWidget::signalPopupMenu (pWidget=0x55712152de30, widget=0x55711a2c0900) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:2701
    #55 0x00007f57f6c9adb5 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #56 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #57 0x00007f5805540d83 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #58 0x00007f5805548440 in g_signal_emitv () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #59 0x00007f57f6cce9f5 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #60 0x00007f57f6cceff0 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #61 0x00007f57f6cd04bb in gtk_bindings_activate_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #62 0x00007f57f6c97caa in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #63 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #64 0x00007f5805541360 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #65 0x00007f5805542072 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #66 0x00007f5805548666 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #67 0x00007f5805548723 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #68 0x00007f57f6f551cc in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #69 0x00007f57f6f78143 in gtk_window_propagate_key_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #70 0x00007f57f6f7c9fb in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #71 0x00007f57f77fc4ac in key_forward (pEvent=0x55711a45b0c0, pDest=0x55711ae7bae0) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkframe.cxx:4239
    #72 0x00007f57f77f2f8d in GtkSalFrame::signalKey (pWidget=0x55711ae7bae0, pEvent=0x55711a45b0c0, frame=0x55711af84100) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkframe.cxx:4300
    #73 0x00007f57f6c97caa in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #74 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #75 0x00007f5805540d83 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #76 0x00007f5805542072 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #77 0x00007f5805548666 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #78 0x00007f5805548723 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #79 0x00007f57f6f551cc in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #80 0x00007f57f6e05e6f in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #81 0x00007f57f6e07b76 in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #82 0x00007f57f7da7ce9 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
    #83 0x00007f57f7ddc096 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
    #84 0x00007f57fd10b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #85 0x00007f57fd10da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #86 0x00007f57fd10e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #87 0x00007f57f768350c in GtkSalData::Yield (this=0x55711906f850, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkdata.cxx:405
    #88 0x00007f57f7688413 in GtkInstance::DoYield (this=0x55711906f700, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:439
    #89 0x00007f5802088706 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #90 0x00007f580208801f in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488
    #91 0x00007f5802087e00 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360
    #92 0x00007f580af287f9 in desktop::Desktop::Main (this=0x7ffcf6397a70) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1679
    #93 0x00007f58020a9b86 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
    #94 0x00007f58020ab779 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
    #95 0x00007f580afa20da in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
    #96 0x00005570fb1c4a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #97 0x00005570fb1c4a47 in main (argc=2, argv=0x7ffcf6397c78) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

Change-Id: I20d037038c0d4a84d104bf9987bae28835dac609
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181110
Reviewed-by: Michael Weghorn <[email protected]>
Reviewed-by: Noel Grandin <[email protected]>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Feb 5, 2025
When opening the popup menu by right-clicking on a Writer
comment and selecting "Delete All Comments", the SwAnnotationWin
(`mrSidebarWin`) gets disposed while the popup menu and its associated
MenuFloatingWindow are still alive. With the menu floating window
being a child of the SwAnnotationWin, that would trigger the
below assert since

    commit 6708246
    Author: Michael Weghorn <[email protected]>
    Date:   Thu Dec 5 11:06:48 2024 +0000

        tdf#164093 tdf#157001 a11y: Improve menu window disposal

Avoid disposing parent window before its child by not using
the SwAnnotationWin, but its parent as the popup menu
parent.

    warn:legacy.osl:64828:64828:vcl/source/window/window.cxx:307: Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()
    Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()
    [New Thread 64828.64829]
    [New Thread 64828.64830]
    [New Thread 64828.64831]
    [New Thread 64828.64832]
    [New Thread 64828.64833]
    [New Thread 64828.64835]

    Thread 1 received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    warning: 44     ./nptl/pthread_kill.c: No such file or directory
    (rr) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f580ac9de2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f580ac49d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f580ac324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f5801fbc2cb in SalAbort (rErrorText="Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()", bDumpCore=true)
        at /home/michi/development/git/libreoffice/vcl/source/app/salplug.cxx:403
    #5  0x00007f5802087961 in Application::Abort (rErrorText="Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed:  18MenuFloatingWindow()")
        at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:300
    #6  0x00007f580188bba8 in vcl::Window::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:308
    #7  0x00007f5801902216 in Control::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/control/ctrl.cxx:61
    #8  0x00007f58019552cc in InterimItemWindow::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/control/InterimItemWindow.cxx:54
    #9  0x00007f57ca8fb980 in sw::annotation::SwAnnotationWin::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/AnnotationWin.cxx:189
    #10 0x00007f5801b06ee3 in VclReferenceBase::disposeOnce (this=0x55711f0667e8) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #11 0x00007f57ca939d52 in VclPtr<sw::annotation::SwAnnotationWin>::disposeAndClear (this=0x5571205dc3e0) at include/vcl/vclptr.hxx:207
    #12 0x00007f57ca9260b5 in SwPostItMgr::RemoveItem (this=0x55711a340eb0, pBroadcast=0x55711fe07bb0) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:529
    #13 0x00007f57ca926662 in SwPostItMgr::Notify (this=0x55711a340eb0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:595
    #14 0x00007f5806551a4c in SfxBroadcaster::Broadcast (this=0x55711fe07bb0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
    #15 0x00007f57ca0e62c9 in SwpHints::DeleteAtPos (this=0x5571215061d0, nPos=0) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/thints.cxx:3440
    #16 0x00007f57ca0b31d1 in SwTextNode::EraseText (this=0x55711a2d3070, rIdx=SwContentIndex (node 9 offset 4), nCount=1, nMode=SwInsertFlags::DEFAULT) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/ndtxt.cxx:2877
    #17 0x00007f57ca0b501d in SwTextNode::EraseText (this=0x55711a2d3070, rIdx=SwPosition (node 9, offset 4), nCount=1, nMode=SwInsertFlags::DEFAULT) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/ndtxt.cxx:2837
    #18 0x00007f57ca1494c2 in SwUndoDelete::SaveContent (this=0x557121daf110, pStart=0x7ffcf6391340, pEnd=0x7ffcf6391388, pSttTextNd=0x55711a2d3070, pEndTextNd=0x55711a2d3070)
        at /home/michi/development/git/libreoffice/sw/source/core/undo/undel.cxx:476
    #19 0x00007f57ca147457 in SwUndoDelete::SwUndoDelete (this=0x557121daf110, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection, bFullPara=false, bCalledByTableCpy=false)
        at /home/michi/development/git/libreoffice/sw/source/core/undo/undel.cxx:264
    #20 0x00007f57c97e72e8 in std::make_unique<SwUndoDelete, SwPaM&, SwDeleteFlags const&> (__args=SwPaM = {...}, __args=@0x7ffcf6391214: SwDeleteFlags::ArtificialSelection)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:1077
    #21 0x00007f57c97d79a1 in sw::DocumentContentOperationsManager::DeleteRangeImplImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4574
    #22 0x00007f57c97bf899 in sw::DocumentContentOperationsManager::DeleteRangeImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4500
    #23 0x00007f57c97c2cf9 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4471
    #24 0x00007f57c97bfc2d in (anonymous namespace)::lcl_DoWithBreaks
        (rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection, pFunc=(bool (sw::DocumentContentOperationsManager::*)(class sw::DocumentContentOperationsManager * const, class SwPaM &, enum SwDeleteFlags)) 0x7f57c97c2cb0 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:686
    #25 0x00007f57c97c1773 in sw::DocumentContentOperationsManager::DeleteAndJoin (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
        at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2377
    #26 0x00007f57c9a7ef97 in SwEditShell::DeleteSel (this=0x55711b0054e0, rPam=SwPaM = {...}, isArtificialSelection=true, goLeft=false, pUndo=0x7ffcf6391d9f) at /home/michi/development/git/libreoffice/sw/source/core/edit/eddel.cxx:122
    #27 0x00007f57c9a7f538 in SwEditShell::Delete (this=0x55711b0054e0, isArtificialSelection=true, goLeft=false) at /home/michi/development/git/libreoffice/sw/source/core/edit/eddel.cxx:164
    #28 0x00007f57cae1c83b in SwWrtShell::DelRight (this=0x55711b0054e0, isReplaceHeuristic=false) at /home/michi/development/git/libreoffice/sw/source/uibase/wrtsh/delete.cxx:419
    #29 0x00007f57ca930aaa in SwPostItMgr::Delete (this=0x55711a340eb0) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:1770
    #30 0x00007f57caa8d050 in SwAnnotationShell::NoteExec (this=0x55711eef12c0, rReq=...) at /home/michi/development/git/libreoffice/sw/source/uibase/shells/annotsh.cxx:1170
    #31 0x00007f57caa8cf15 in SfxStubSwAnnotationShellNoteExec (pShell=0x55711eef12c0, rReq=...) at workdir/SdiTarget/sw/sdi/swslots.hxx:19464
    #32 0x00007f5806fc9fbe in SfxDispatcher::Call_Impl (this=0x55711ae7d3b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:255
    #33 0x00007f5806fce446 in SfxDispatcher::Execute_ (this=0x55711ae7d3b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:754
    #34 0x00007f5806fb6c8e in SfxBindings::Execute_Impl (this=0x55711de05e80, aReq=..., pSlot=0x7f57caf33a18 <aSwAnnotationShellSlots_Impl+8712>, pShell=0x55711eef12c0)
        at /home/michi/development/git/libreoffice/sfx2/source/control/bindings.cxx:1045
    #35 0x00007f580709d8bd in SfxDispatchController_Impl::dispatch (this=0x55711e141080, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:735
    #36 0x00007f580709c374 in SfxOfficeDispatch::dispatch (this=0x55711e140fe0, aURL=..., aArgs=empty uno::Sequence) at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:254
    #37 0x00007f5808307ddb in framework::MenuBarManager::Select (this=0x55711fe3b8c0, pMenu=0x5571215e12b0) at /home/michi/development/git/libreoffice/framework/source/uielement/menubarmanager.cxx:821
    #38 0x00007f580830784d in framework::MenuBarManager::LinkStubSelect (instance=0x55711fe3b8c0, data=0x5571215e12b0) at /home/michi/development/git/libreoffice/framework/source/uielement/menubarmanager.cxx:776
    #39 0x00007f58017a64f6 in Link<Menu*, bool>::Call (this=0x5571215e1320, data=0x5571215e12b0) at include/tools/link.hxx:105
    #40 0x00007f5801798233 in Menu::Select (this=0x5571215e12b0) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:352
    #41 0x00007f58017a56a8 in PopupMenu::ImplFlushPendingSelect (this=0x5571215e12b0) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2872
    #42 0x00007f58017a5ced in PopupMenu::FinishRun (this=0x5571215e12b0, pWin=..., pParentWin=..., bRealExecute=true, bIsNativeMenu=true) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:3108
    #43 0x00007f58017a5487 in PopupMenu::ImplExecute
        (this=0x5571215e12b0, pParentWin=..., rRect=..., nPopupModeFlags=(FloatWinPopupFlags::Down | FloatWinPopupFlags::NoKeyClose | FloatWinPopupFlags::AllMouseButtonClose | FloatWinPopupFlags::NewLevel | FloatWinPopupFlags::NoMouseUpClose | FloatWinPopupFlags::GrabFocus), pSFrom=0x0, bPreSelectFirst=false) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:3033
    #44 0x00007f58017a3eca in PopupMenu::Execute (this=0x5571215e12b0, pExecWindow=0x55711f066550, rRect=..., nFlags=(PopupMenuFlags::ExecuteDown | PopupMenuFlags::NoMouseUpClose))
        at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2860
    #45 0x00007f58034b67d3 in VCLXMenu::execute (this=0x5571215df5a0, rxWindowPeer=uno::Reference to (VCLXWindow *) 0x55711ef4bbe8, rPos=..., nFlags=1) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxmenu.cxx:509
    #46 0x00007f5806fd2d91 in SfxDispatcher::ExecutePopup (this=0x55711ae7d3b0, rResName="annotation", pWin=0x55711f066550, pPos=0x7ffcf6394968) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1937
    #47 0x00007f5806fd2186 in SfxDispatcher::ExecutePopup (pWin=0x55711f066550, pPos=0x7ffcf6394968) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1785
    #48 0x00007f57ca95d2c3 in sw::sidebarwindows::SidebarTextControl::Command (this=0x5571215354d0, rCEvt=...) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/SidebarTxtControl.cxx:443
    #49 0x00007f5801fb39e1 in weld::CustomWeld::DoCommand (this=0x557121536330, rPos=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:93
    #50 0x00007f5801fb371d in weld::CustomWeld::LinkStubDoCommand (instance=0x557121536330, data=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:91
    #51 0x00007f57f7799bb6 in Link<CommandEvent const&, bool>::Call (this=0x55711a2c0bd0, data=...) at include/tools/link.hxx:105
    #52 0x00007f57f7703ba8 in (anonymous namespace)::GtkInstanceDrawingArea::signal_command (this=0x55711a2c0900, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:19099
    #53 0x00007f57f7701f3d in (anonymous namespace)::GtkInstanceDrawingArea::signal_popup_menu (this=0x55711a2c0900, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:18731
    #54 0x00007f57f76e3cc7 in (anonymous namespace)::GtkInstanceWidget::signalPopupMenu (pWidget=0x55712152de30, widget=0x55711a2c0900) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:2701
    #55 0x00007f57f6c9adb5 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #56 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #57 0x00007f5805540d83 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #58 0x00007f5805548440 in g_signal_emitv () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #59 0x00007f57f6cce9f5 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #60 0x00007f57f6cceff0 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #61 0x00007f57f6cd04bb in gtk_bindings_activate_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #62 0x00007f57f6c97caa in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #63 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #64 0x00007f5805541360 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #65 0x00007f5805542072 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #66 0x00007f5805548666 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #67 0x00007f5805548723 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #68 0x00007f57f6f551cc in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #69 0x00007f57f6f78143 in gtk_window_propagate_key_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #70 0x00007f57f6f7c9fb in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #71 0x00007f57f77fc4ac in key_forward (pEvent=0x55711a45b0c0, pDest=0x55711ae7bae0) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkframe.cxx:4239
    #72 0x00007f57f77f2f8d in GtkSalFrame::signalKey (pWidget=0x55711ae7bae0, pEvent=0x55711a45b0c0, frame=0x55711af84100) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkframe.cxx:4300
    #73 0x00007f57f6c97caa in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #74 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #75 0x00007f5805540d83 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #76 0x00007f5805542072 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #77 0x00007f5805548666 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #78 0x00007f5805548723 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #79 0x00007f57f6f551cc in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #80 0x00007f57f6e05e6f in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #81 0x00007f57f6e07b76 in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
    #82 0x00007f57f7da7ce9 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
    #83 0x00007f57f7ddc096 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
    #84 0x00007f57fd10b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #85 0x00007f57fd10da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #86 0x00007f57fd10e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #87 0x00007f57f768350c in GtkSalData::Yield (this=0x55711906f850, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkdata.cxx:405
    #88 0x00007f57f7688413 in GtkInstance::DoYield (this=0x55711906f700, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:439
    #89 0x00007f5802088706 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #90 0x00007f580208801f in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488
    #91 0x00007f5802087e00 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360
    #92 0x00007f580af287f9 in desktop::Desktop::Main (this=0x7ffcf6397a70) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1679
    #93 0x00007f58020a9b86 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
    #94 0x00007f58020ab779 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
    #95 0x00007f580afa20da in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
    #96 0x00005570fb1c4a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #97 0x00005570fb1c4a47 in main (argc=2, argv=0x7ffcf6397c78) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

Change-Id: I20d037038c0d4a84d104bf9987bae28835dac609
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181110
Reviewed-by: Michael Weghorn <[email protected]>
Reviewed-by: Noel Grandin <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 0467f88)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181134
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Feb 7, 2025
The EditBrowseBoxTableCell ctor's first param is the
parent, the second one is the owner.

The EditBrowseBoxTableCellAccess is the owner, but not the
parent, which means that the params were passed in the
wrong order.

Since EditBrowseBoxTableCellAccess::getAccessibleContext
returns the EditBrowseBoxTableCell, this would result
in the EditBrowseBoxTableCell reporting itself as
its own parent.

This results in infinite recursion when trying to walk
up the a11y hierarchy starting at the EditBrowseBoxTableCell.

Switch the order of the first 2 params to fix that.

This addresses a preexisting issue that was now
triggering a crash as described in

    commit 261dd0fd48b2e2c284485c25feade854154595aa
    Author: Michael Weghorn <[email protected]>
    Date:   Fri Jan 31 11:40:09 2025 +0100

        browsebox a11y: Use comphelper::OAccessibleComponentHelper

        [...]

        Sample scenario for BrowseBox:

        1) Start Base, create a new database
        2) With the "Tables" section enabled, click on
           "Create Table in Design View..."
        3) in Accerciser's treeview of the LO a11y, navigate
           through the a11y objects of the table and its children

        A quick test with Orca [...] triggered
        a crash for the BrowseBox case.

        The underlying problem is a preexisting issue however, and
        will be addressed in an upcoming commit.

Sample backtrace:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007fd5a4700cde in std::scoped_lock<std::mutex>::scoped_lock (this=0x7ffe58c71100, __m=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/mutex:787
    787           { _M_device.lock(); }
    (rr) bt
    #0  0x00007fd5a4700cde in std::scoped_lock<std::mutex>::scoped_lock (this=0x7ffe58c71100, __m=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/mutex:787
    #1  0x00007fd5a47402e4 in cppu::getTypeEntries
        (cd=0x7fd59e2da610 <cppu::detail::ImplClassData<cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleComponent>, com::sun::star::accessibility::XAccessibleComponent>::operator()()::s_cd>) at /home/michi/development/git/libreoffice/cppuhelper/source/implbase_ex.cxx:69
    #2  0x00007fd5a473f399 in cppu::queryDeepNoXInterface
        (pDemandedTDR=0x55ca49389ab0, cd=0x7fd59e2da610 <cppu::detail::ImplClassData<cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleComponent>, com::sun::star::accessibility::XAccessibleComponent>::operator()()::s_cd>, that=0x55ca4a156260) at /home/michi/development/git/libreoffice/cppuhelper/source/implbase_ex.cxx:148
    #3  0x00007fd5a473f917 in cppu::ImplHelper_queryNoXInterface
        (rType=invalid uno::Type, cd=0x7fd59e2da610 <cppu::detail::ImplClassData<cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleComponent>, com::sun::star::accessibility::XAccessibleComponent>::operator()()::s_cd>, that=0x55ca4a156260) at /home/michi/development/git/libreoffice/cppuhelper/source/implbase_ex.cxx:225
    #4  0x00007fd59ccdac55 in cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleComponent>::queryInterface (this=0x55ca4a156260, aType=invalid uno::Type)
        at include/cppuhelper/implbase.hxx:165
    #5  0x00007fd59ccd8375 in cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper, com::sun::star::awt::XFocusListener, com::sun::star::lang::XServiceInfo>::queryInterface (this=0x55ca4a156260, aType=invalid uno::Type)
        at include/cppuhelper/implbase.hxx:166
    #6  0x00007fd59ccfab51 in EditBrowseBoxTableCell::queryInterface (this=0x55ca4a156260, _rType=invalid uno::Type) at /home/michi/development/git/libreoffice/vcl/source/accessibility/accessibleeditbrowseboxcell.cxx:62
    #7  0x00007fd59ccd9ac5 in com::sun::star::uno::BaseReference::iquery (pInterface=0x55ca4a156260, rType=invalid uno::Type) at include/com/sun/star/uno/Reference.hxx:59
    #8  0x00007fd59cce8739 in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::iquery (pInterface=0x55ca4a156260) at include/com/sun/star/uno/Reference.hxx:74
    #9  0x00007fd59ccfe39c in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::query (rRef=...) at include/com/sun/star/uno/Reference.hxx:380
    #10 0x00007fd59ccfd0b6 in com::sun::star::uno::WeakReference<com::sun::star::accessibility::XAccessibleContext>::operator com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext> (this=0x55ca4a14a1e0)
        at include/cppuhelper/weakref.hxx:218
    #11 0x00007fd59ccfc4d1 in EditBrowseBoxTableCellAccess::getAccessibleContext (this=0x55ca4a14a1a0) at /home/michi/development/git/libreoffice/vcl/source/accessibility/accessibleeditbrowseboxcell.cxx:202
    #12 0x00007fd59ccfc6a4 in non-virtual thunk to EditBrowseBoxTableCellAccess::getAccessibleContext() () at /home/michi/development/git/libreoffice/instdir/program/libvcllo.so
    #13 0x00007fd5a4ce8642 in comphelper::OCommonAccessibleComponent::implGetParentContext (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:208
    #14 0x00007fd5a4ce8bdb in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:238
    #15 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #16 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #17 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #18 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #19 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #20 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #21 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #22 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #23 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #24 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #25 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #26 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #27 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #28 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #29 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #30 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #31 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #32 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #33 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #34 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #35 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #36 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #37 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #38 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #39 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #40 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #41 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #42 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #43 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #44 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #45 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #46 0x00007fd5a4ce90a9 in non-virtual thunk to comphelper::OAccessibleComponentHelper::getLocationOnScreen() () at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    #47 0x00007fd5a4ce8cb6 in comphelper::OCommonAccessibleComponent::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:242
    #48 0x00007fd5a4ce9075 in comphelper::OAccessibleComponentHelper::getLocationOnScreen (this=0x55ca4a156260) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:285
    [...]

Change-Id: If8b0edba80c804ba621c808495358d6358be96ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181154
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Feb 7, 2025
Fixes a deadlock seen for this scenario
with the qt6 VCL plugin on Linux:

1) start Orca
2) Start Base, create a new database
2) With the "Tables" section enabled, click on
   "Create Table in Design View..."
3) click around in the table, use Tab key to move focus

AccessibleBrowseBoxAccess::commitEvent (frame 20 in the below
backtrace) locks the mutex, and then
AccessibleBrowseBoxAccess::getAccessibleContext (frame 8) tries to
acquire the mutex again and deadlocks.

Locking in AccessibleBrowseBoxAccess::commitEvent was added in

    commit 67158da
    Date:   Fri Oct 4 14:22:22 2024 +0100

        cid#1608061 Data race condition

        and

        cid#1607995 Data race condition

Backtrace:

    Thread 1 "soffice.bin" received signal SIGINT, Interrupt.
    futex_wait (futex_word=0x7fffd804ba30, expected=2, private=0) at ../sysdeps/nptl/futex-internal.h:146
    warning: 146    ../sysdeps/nptl/futex-internal.h: No such file or directory
    (gdb) bt
    #0  futex_wait (futex_word=0x7fffd804ba30, expected=2, private=0) at ../sysdeps/nptl/futex-internal.h:146
    #1  __GI___lll_lock_wait (futex=futex@entry=0x7fffd804ba30, private=0) at ./nptl/lowlevellock.c:49
    #2  0x00007ffff789f3a2 in lll_mutex_lock_optimized (mutex=0x7fffd804ba30) at ./nptl/pthread_mutex_lock.c:48
    #3  ___pthread_mutex_lock (mutex=0x7fffd804ba30) at ./nptl/pthread_mutex_lock.c:93
    #4  0x00007fffee0d742f in __gthread_mutex_lock (__mutex=0x7fffd804ba30) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:762
    #5  0x00007fffee0d9915 in std::mutex::lock (this=0x7fffd804ba30) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_mutex.h:113
    #6  0x00007fffee0d98e4 in std::unique_lock<std::mutex>::lock (this=0x7fffffff3b48) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_lock.h:147
    #7  0x00007fffee0d8108 in std::unique_lock<std::mutex>::unique_lock (this=0x7fffffff3b48, __m=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_lock.h:73
    #8  0x00007fffee0d729d in AccessibleBrowseBoxAccess::getAccessibleContext (this=0x7fffd804ba00) at /home/michi/development/git/libreoffice/vcl/source/accessibility/AccessibleBrowseBox.cxx:281
    #9  0x00007fffee0d7404 in non-virtual thunk to AccessibleBrowseBoxAccess::getAccessibleContext() () at /home/michi/development/git/libreoffice/instdir/program/libvcllo.so
    #10 0x00007fffe42c3b8c in QtAccessibleWidget::getAccessibleContextImpl (this=0x7fffd804b9a0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:93
    #11 0x00007fffe42c451d in QtAccessibleWidget::childCount (this=0x7fffd804b9a0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:149
    #12 0x00007fffe290e9d5 in AtSpiAdaptor::notifyAboutCreation (this=0x555556916e10, interface=0x7fffd8051df0) at /home/michi/development/git/qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1403
    #13 0x00007fffe290ad18 in AtSpiAdaptor::notify (this=0x555556916e10, event=0x7fffffff5e40) at /home/michi/development/git/qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:971
    #14 0x00007fffe2966779 in QSpiAccessibleBridge::notifyAccessibilityUpdate (this=0x5555568aab30, event=0x7fffffff5e40) at /home/michi/development/git/qt5/qtbase/src/gui/accessible/linux/qspiaccessiblebridge.cpp:85
    #15 0x00007fffe28e5c89 in QAccessible::updateAccessibility (event=0x7fffffff5e40) at /home/michi/development/git/qt5/qtbase/src/gui/accessible/qaccessible.cpp:943
    #16 0x00007fffe42bb466 in QtAccessibleEventListener::notifyEvent (this=0x555557d6de30, rEvent=...) at vcl/qt6/../qt5/QtAccessibleEventListener.cxx:231
    #17 0x00007ffff60ec617 in comphelper::AccessibleEventNotifier::addEvent (_nClient=288, _rEvent=...) at /home/michi/development/git/libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:256
    #18 0x00007ffff60e8107 in comphelper::OCommonAccessibleComponent::NotifyAccessibleEvent (this=0x55555be2f520, _nEventId=7, _rOldValue=uno::Any(void), _rNewValue=uno::Any("com.sun.star.accessibility.XAccessible": ...), nIndexHint=-1)
        at /home/michi/development/git/libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:127
    #19 0x00007fffee0dd7c9 in AccessibleBrowseBoxBase::commitEvent (this=0x55555be2f520, _nEventId=7, _rNewValue=uno::Any("com.sun.star.accessibility.XAccessible": ...), _rOldValue=uno::Any(void))
        at /home/michi/development/git/libreoffice/vcl/source/accessibility/AccessibleBrowseBoxBase.cxx:310
    #20 0x00007fffee0d8fb0 in AccessibleBrowseBoxAccess::commitEvent (this=0x7fffd804ba00, nEventId=7, rNewValue=uno::Any("com.sun.star.accessibility.XAccessible": ...), rOldValue=uno::Any(void))
        at vcl/inc/accessibility/AccessibleBrowseBox.hxx:250
    #21 0x00007ffff08806b6 in BrowseBox::commitBrowseBoxEvent (this=0x55555bdc8bf0, _nEventId=7, _rNewValue=uno::Any("com.sun.star.accessibility.XAccessible": ...), _rOldValue=uno::Any(void))
        at /home/michi/development/git/libreoffice/svtools/source/brwbox/brwbox3.cxx:406
    #22 0x00007ffff08a090b in svt::EditBrowseBox::implCreateActiveAccessible (this=0x55555bdc8bf0) at /home/michi/development/git/libreoffice/svtools/source/brwbox/editbrowsebox2.cxx:87
    #23 0x00007ffff089c7af in svt::EditBrowseBox::ActivateCell (this=0x55555bdc8bf0, nRow=0, nCol=1, bCellFocus=true) at /home/michi/development/git/libreoffice/svtools/source/brwbox/editbrowsebox.cxx:945
    #24 0x00007ffff089e6c0 in svt::EditBrowseBox::ActivateCell (this=0x55555bdc8bf0) at include/svtools/editbrowsebox.hxx:1029
    #25 0x00007ffff089b291 in svt::EditBrowseBox::implActivateCellOnMouseEvent (this=0x55555bdc8bf0, _rEvt=..., _bUp=true) at /home/michi/development/git/libreoffice/svtools/source/brwbox/editbrowsebox.cxx:482
    #26 0x00007ffff089b43c in svt::EditBrowseBox::MouseButtonUp (this=0x55555bdc8bf0, rEvt=...) at /home/michi/development/git/libreoffice/svtools/source/brwbox/editbrowsebox.cxx:468
    #27 0x00007ffff08876ad in BrowserDataWin::MouseButtonUp (this=0x555556fed350, rEvt=...) at /home/michi/development/git/libreoffice/svtools/source/brwbox/datwin.cxx:490
    #28 0x00007fffee4b1055 in ImplHandleMouseEvent (xWindow=..., nSVEvent=NotifyEventType::MOUSEBUTTONUP, bMouseLeave=false, nX=73, nY=89, nMsgTime=10536810, nCode=1, nMode=(MouseEventModifiers::SIMPLECLICK | MouseEventModifiers::SELECT))
        at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:719
    #29 0x00007fffee4b5571 in ImplHandleSalMouseButtonUp (pWindow=0x7fffd80482c0, pEvent=0x7fffffff8118) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2351
    #30 0x00007fffee4b4280 in ImplWindowFrameProc (_pWindow=0x7fffd80482c0, nEvent=SalEvent::MouseButtonUp, pEvent=0x7fffffff8118) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2700
    #31 0x00007fffe435910c in SalFrame::CallCallback (this=0x555556abc050, nEvent=SalEvent::MouseButtonUp, pEvent=0x7fffffff8118) at vcl/inc/salframe.hxx:311
    #32 0x00007fffe43563b5 in QtFrame::CallCallback (this=0x555556abc040, nEvent=SalEvent::MouseButtonUp, pEvent=0x7fffffff8118) at vcl/inc/qt6/../qt5/QtFrame.hxx:235
    #33 0x00007fffe445475a in QtWidget::handleMouseButtonEvent (rFrame=..., pEvent=0x7fffffff93c0) at vcl/qt6/../qt5/QtWidget.cxx:117
    #34 0x00007fffe4454a11 in QtWidget::mouseReleaseEvent (this=0x7fffd8048d90, pEvent=0x7fffffff93c0) at vcl/qt6/../qt5/QtWidget.cxx:128
    #35 0x00007fffe149f8ad in QWidget::event (this=0x7fffd8048d90, event=0x7fffffff93c0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8964
    #36 0x00007fffe44569ae in QtWidget::event (this=0x7fffd8048d90, pEvent=0x7fffffff93c0) at vcl/qt6/../qt5/QtWidget.cxx:678
    #37 0x00007fffe13e2e20 in QApplicationPrivate::notify_helper (this=0x555555577ae0, receiver=0x7fffd8048d90, e=0x7fffffff93c0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #38 0x00007fffe13e4af2 in QApplication::notify (this=0x555555564d60, receiver=0x7fffd8048d90, e=0x7fffffff93c0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2782
    #39 0x00007fffe344b419 in QCoreApplication::notifyInternal2 (receiver=0x7fffd8048d90, event=0x7fffffff93c0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #40 0x00007fffe344c119 in QCoreApplication::sendSpontaneousEvent (receiver=0x7fffd8048d90, event=0x7fffffff93c0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1566
    #41 0x00007fffe13e3747 in QApplicationPrivate::sendMouseEvent
        (receiver=0x7fffd8048d90, event=0x7fffffff93c0, alienWidget=0x7fffd8048d90, nativeWidget=0x555556f2f660, buttonDown=0x7fffe1fca488 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
        at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2363
    #42 0x00007fffe14ded48 in QWidgetWindow::handleMouseEvent (this=0x5555577f5b40, event=0x7fffffffa498) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:669
    #43 0x00007fffe14dd555 in QWidgetWindow::event (this=0x5555577f5b40, event=0x7fffffffa498) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #44 0x00007fffe13e2e20 in QApplicationPrivate::notify_helper (this=0x555555577ae0, receiver=0x5555577f5b40, e=0x7fffffffa498) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #45 0x00007fffe13e6d3d in QApplication::notify (this=0x555555564d60, receiver=0x5555577f5b40, e=0x7fffffffa498) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #46 0x00007fffe344b419 in QCoreApplication::notifyInternal2 (receiver=0x5555577f5b40, event=0x7fffffffa498) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #47 0x00007fffe344c119 in QCoreApplication::sendSpontaneousEvent (receiver=0x5555577f5b40, event=0x7fffffffa498) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1566
    #48 0x00007fffe2285ca2 in QGuiApplicationPrivate::processMouseEvent (e=0x7fffd0001560) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #49 0x00007fffe2284e66 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x7fffd0001560) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #50 0x00007fffe236d57d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #51 0x00007fffe236d42e in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #52 0x00007fffdf8b2685 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x5555555c8390) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:526
    #53 0x00007fffdf8ce4e5 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**)::{lambda()#1}::operator()() const (this=0x7fffffffa9a0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #54 0x00007fffdf8ce40d in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**)::{lambda()#1}&&) (args=0x7fffd0002f98, fn=...) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #55 0x00007fffdf8ce32f in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**) (f=(void (QtWaylandClient::QWaylandDisplay::*)(class QtWaylandClient::QWaylandDisplay * const)) 0x7fffdf8b2640 <QtWaylandClient::QWaylandDisplay::flushRequests()>, o=0x5555555c8390, arg=0x7fffd0002f98)
        at qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #56 0x00007fffdf8ce2a1 in QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay::*)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**)
        (f=(void (QtWaylandClient::QWaylandDisplay::*)(class QtWaylandClient::QWaylandDisplay * const)) 0x7fffdf8b2640 <QtWaylandClient::QWaylandDisplay::flushRequests()>, o=0x5555555c8390, arg=0x7fffd0002f98)
        at qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #57 0x00007fffdf8ce1cb in QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
        (which=1, this_=0x5555555e1390, r=0x5555555c8390, a=0x7fffd0002f98, ret=0x0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #58 0x00007fffe3461362 in QtPrivate::QSlotObjectBase::call (this=0x5555555e1390, r=0x5555555c8390, a=0x7fffd0002f98) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #59 0x00007fffe350ad5c in QMetaCallEvent::placeMetaCall (this=0x7fffd0002f50, object=0x5555555c8390) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:620
    #60 0x00007fffe350cab1 in QObject::event (this=0x5555555c8390, e=0x7fffd0002f50) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1429
    #61 0x00007fffe13e2e20 in QApplicationPrivate::notify_helper (this=0x555555577ae0, receiver=0x5555555c8390, e=0x7fffd0002f50) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #62 0x00007fffe13e6d3d in QApplication::notify (this=0x555555564d60, receiver=0x5555555c8390, e=0x7fffd0002f50) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #63 0x00007fffe344b419 in QCoreApplication::notifyInternal2 (receiver=0x5555555c8390, event=0x7fffd0002f50) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1112
    #64 0x00007fffe344c089 in QCoreApplication::sendEvent (receiver=0x5555555c8390, event=0x7fffd0002f50) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1552
    #65 0x00007fffe344cfc8 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55555559f110) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1892
    #66 0x00007fffe344becc in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1746
    #67 0x00007fffe3a3d4a1 in postEventSourceDispatch (s=0x5555555f0f80) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
    #68 0x00007fffea10b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #69 0x00007fffea10da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #70 0x00007fffea10e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #71 0x00007fffe3a3c6db in QEventDispatcherGlib::processEvents (this=0x555555568dc0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #72 0x00007fffe2b7a148 in QPAEventDispatcherGlib::processEvents (this=0x555555568dc0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #73 0x00007fffe4376a82 in QtInstance::ImplYield (this=0x5555555f5a00, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:485
    #74 0x00007fffe4379d51 in QtInstance::DoYield (this=0x5555555f5a00, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:496
    #75 0x00007fffeec869b6 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
    #76 0x00007fffeec862cf in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488
    #77 0x00007fffeec860b0 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360
    #78 0x00007ffff7b287f9 in desktop::Desktop::Main (this=0x7fffffffd5d0) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1679
    #79 0x00007fffeeca7e36 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
    #80 0x00007fffeeca9a29 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
    #81 0x00007ffff7ba20da in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
    #82 0x0000555555555a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #83 0x0000555555555a47 in main (argc=2, argv=0x7fffffffd7d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

Change-Id: Id3832663f5c5c66a4d624054fee4d48219732b95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181155
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Feb 8, 2025
... and merge it with QtMenu::ImplRemoveMenuBarButton
that it was previously calling.

This fixes the below assert that gets triggered when
extension updates are available.
(In my case, a fake update notification was triggered
by forcing it with the changes from demo Gerrit change [1].)

    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007fb5a6e9de2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007fb5a6e49d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007fb5a6e324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007fb592902f8d in qAbort () at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:46
    #5  0x00007fb592949948 in qt_message_fatal<QString&> (context=..., message=...) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2062
    #6  0x00007fb592942b4d in qt_message (msgType=QtFatalMsg, context=..., msg=0x7fb593090df3 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fb55fffb4b0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:342
    #7  0x00007fb592944e9d in QMessageLogger::fatal (this=0x7fb55fffb650, msg=0x7fb593090df3 "ASSERT failure in %s: \"%s\", file %s, line %d") at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:831
    #8  0x00007fb592903043 in qt_assert_x
        (where=0x7fb59309a8b9 "QCoreApplication::sendEvent", what=0x5628d475e9f0 "Cannot send events to objects owned by a different thread. Current thread QThread(0x5628d4691800). Receiver 'QWidget(0x5628d4472f70)' was created in thread QThread(0x5628cb7b0e20, name = \"Qt mainThrea"..., file=0x7fb59309a695 "/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp", line=530)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:115
    #9  0x00007fb592a490b6 in QCoreApplicationPrivate::checkReceiverThread (receiver=0x5628d4472f70) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:526
    #10 0x00007fb5909e4011 in QApplication::notify (this=0x5628cb7b0d60, receiver=0x5628d4472f70, e=0x7fb55fffc2d8) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2590
    #11 0x00007fb592a4a8d9 in QCoreApplication::notifyInternal2 (receiver=0x5628d4472f70, event=0x7fb55fffc2d8) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1098
    #12 0x00007fb592a4b549 in QCoreApplication::sendEvent (receiver=0x5628d4472f70, event=0x7fb55fffc2d8) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1538
    #13 0x00007fb590a8816a in QWidget::~QWidget (this=0x5628d4472f70) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1569
    #14 0x00007fb590c285db in QAbstractButton::~QAbstractButton (this=0x5628d4472f70) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:453
    #15 0x00007fb590da0b89 in QPushButton::~QPushButton (this=0x5628d4472f70) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qpushbutton.cpp:250
    #16 0x00007fb590da0bcd in QPushButton::~QPushButton (this=0x5628d4472f70) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qpushbutton.cpp:249
    #17 0x00007fb593a30f8a in QtMenu::ImplRemoveMenuBarButton (this=0x5628d06d8840, nId=2) at vcl/qt6/../qt5/QtMenu.cxx:872
    #18 0x00007fb593a315a0 in QtMenu::RemoveMenuBarButton (this=0x5628d06d8840, nId=2) at vcl/qt6/../qt5/QtMenu.cxx:900
    #19 0x00007fb59d9af55e in MenuBarWindow::RemoveMenuBarButton (this=0x5628d08cd990, nId=2) at /home/michi/development/git/libreoffice/vcl/source/window/menubarwindow.cxx:1191
    #20 0x00007fb59d99b766 in MenuBar::RemoveMenuBarButton (this=0x5628d06e8140, nId=2) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2720
    #21 0x00007fb59d7e6ad0 in MenuBarUpdateIconManager::RemoveMenuBarIcon (this=0x5628d48922e8, pMenuBar=0x5628d06e8140) at /home/michi/development/git/libreoffice/vcl/source/window/bubblewindow.cxx:574
    #22 0x00007fb59d7e71d2 in MenuBarUpdateIconManager::RemoveMenuBarIcons (this=0x5628d48922e8) at /home/michi/development/git/libreoffice/vcl/source/window/bubblewindow.cxx:422
    #23 0x00007fb59d7e7284 in MenuBarUpdateIconManager::SetShowMenuIcon (this=0x5628d48922e8, bShowMenuIcon=false) at /home/michi/development/git/libreoffice/vcl/source/window/bubblewindow.cxx:435
    #24 0x00007fb58e5effc7 in (anonymous namespace)::UpdateCheckUI::setPropertyValue (this=0x5628d4892290, rPropertyName="MenuIconVisible", rValue=uno::Any("boolean": 0 '\000'))
        at /home/michi/development/git/libreoffice/extensions/source/update/ui/updatecheckui.cxx:215
    #25 0x00007fb57cafd80e in UpdateCheck::handleMenuBarUI (this=0x7fb560025d40, rUpdateHandler=rtl::Reference to 0x7fb5600279f0, eState=@0x7fb55fffcc44: UPDATESTATE_NO_UPDATE_AVAIL, suppressBubble=true)
        at /home/michi/development/git/libreoffice/extensions/source/update/check/updatecheck.cxx:1287
    #26 0x00007fb57cafa135 in UpdateCheck::setUIState (this=0x7fb560025d40, eState=UPDATESTATE_NO_UPDATE_AVAIL, suppressBubble=true) at /home/michi/development/git/libreoffice/extensions/source/update/check/updatecheck.cxx:1332
    #27 0x00007fb57cafd368 in UpdateCheck::setUpdateInfo (this=0x7fb560025d40, aInfo=...) at /home/michi/development/git/libreoffice/extensions/source/update/check/updatecheck.cxx:1253
    #28 0x00007fb57caff7c3 in (anonymous namespace)::UpdateCheckThread::runCheck (this=0x7fb5600269e0, rbExtensionsChecked=@0x7fb55fffd1a7: false)
        at /home/michi/development/git/libreoffice/extensions/source/update/check/updatecheck.cxx:389
    #29 0x00007fb57cafefd3 in (anonymous namespace)::UpdateCheckThread::run (this=0x7fb5600269e0) at /home/michi/development/git/libreoffice/extensions/source/update/check/updatecheck.cxx:508
    #30 0x00007fb57cb08a4e in threadFunc (param=0x7fb5600269e0) at include/osl/thread.hxx:189
    #31 0x00007fb5a7502ccb in osl_thread_start_Impl (pData=0x7fb5600271b0) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:237
    #32 0x00007fb5a6e9c083 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
    #33 0x00007fb5a6f1a5f0 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

[1] https://gerrit.libreoffice.org/c/core/+/106922

Change-Id: I571ec792bf4f83d61f0bc327199559fc47159dca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181281
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants